Home / code / javascript

Assignment Operators

An assignment operator assign a value to itsleft operand based on the value of its operand. The basic assignment operator is equal (=), which assigns the value of its right operand to its left operand. That is, x=y assigns the value of y to x.

Shorthand operator Meaning
x += y x = x + y
x -= y x = x + y
x *= y x = x * y
x /= y x = x / y
x %= y x = x % y
x <<= y x = x << y
x >>= y x = x >> y
x >>>= y x = x >>> y
x &= y x = x & y
x ^= y x = x ^ y
x |= y x = x | y

 

TOP

Latest script:

 

Books: