JavaScript Resources
Assignment Operators
In JavaScript, the following operators can be use to assign values to variables:
For Text
 The = equals sign:
 The += (plus equals), a shorthand operator that concatenates and assigns a value simultaneously:

var message1 = "Hello World!"
var message2 = message1
message2 is now "Hello World!"

var message1 = "Mc"
var message2 = "Donalds"
message2 = message1 + message2
message2 is now "McDonalds"
Using +=, this can also be achieved with:

message1 += message2
For Numbers
 with numbers += is a shorthand for adding two values together and assigning the result to the variable to the left of the equals sign
 There are a number of additional operator shorthands that follow this formula than can be used on numbers as listed in this chart:
 And some obscure ones that you probably won't have much use for:
 There is even a shorthand for a shorthand! The ++ increment operator is a shorthand for += 1
 Similary, the  decrement operator is a shorthand for = 1

var x = 2
x
x is now 1
 The increment and decrement operators can be placed before or after a number, and produce the same result.

var x = 2
var y += 3
var y is now 5
operator  operation 

x = y  x = x  y 
x *= y  x = x * y 
x /= y  x = x / y 
operator  operation 

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 

var x = 1
++x
x is now 2
++x and x++ are equivalent, if the assignment is the entire statement

x = 1
++x
x++
x is now 3
However, the increment and decrement operators can also be used to make an assignment within a statement, which is why they really exist, and at this point have a different meaning. When the operators precede the value, the value is incremented before the rest of the statement is executed. When the operators follow the value, the value is incremented after the rest of the statement is executed.

x = 1
y = ++x
x is now 2
y is now 2
However
x = 1y = x++
x is now 2
but y is 1