Mathematical operations and assignment

suggest change

Increment by

let a = 9,
b = 3;
b += a;

b will now be 12

This is functionally the same as

b = b + a;

Decrement by

let a = 9,
b = 3;
b -= a;

b will now be 6

This is functionally the same as

b = b - a;

Multiply by

let a = 5,
b = 3;
b *= a;

b will now be 15

This is functionally the same as

b = b * a;

Divide by

let a = 3,
b = 15;
b /= a;

b will now be 5

This is functionally the same as

b = b / a;

Raised to the power of

let a = 3,
b = 15;
b **= a;

b will now be 3375

This is functionally the same as

b = b ** a;

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents