Java Reference
In-Depth Information
JavaScript Operators
The following sections list the various operators available to you in JavaScript.
Assignment Operators
Assignment operators allow you to assign a value to a variable. The following table lists the different
assignment operators you can use.
Name
Introduced
Meaning
Assignment
JavaScript 1.0
Sets variable v1 to the value of variable v2.
var v1 = v2;
Shorthand addition
or
Shorthand concatenation
same as
v1 = v1 + v2
JavaScript 1.0
v1 += v2
Shorthand subtraction
same as
v1 = v1 - v2
JavaScript 1.0
v1 -= v2
Shorthand multiplication
same as
v1 = v1 * v2
JavaScript 1.0
v1 *= v2
Shorthand division
same as
v1 = v1 / v2
JavaScript 1.0
v1 /= v2
Shorthand modulus
same as
v1 = v1 % v2
JavaScript 1.0
v1 %= v2
Shorthand left-shift
same as
v1 = v1 << v2
JavaScript 1.0
v1 <<= v2
Shorthand right-shift
same as
v1 = v1 >> v2
JavaScript 1.0
v1 >>= v2
Search WWH ::




Custom Search