|Property/method value type:||Number primitive|
|Argument list:||anOperand1||An expression that evaluates to a number|
|anOperand2||Another numeric value|
Add the right operand to the left operand and assign the result to the left operand.
This is functionally equivalent to the expression:
anOperand1 = anOperand1 + anOperand2;
Although this is classified as an assignment operator, it is really a compound of an assignment and an additive operator.
It also works with string values and will concatenate the second onto the first.
The associativity is right to left.
Refer to the operator precedence topic for details of execution order.
The new value of anOperand1 is returned as a result of the expression.
The operand to the left of the operator must be an LValue. That is, it should be able to take an assignment and store the value.
// Initialize with numeric values myVar1 = 100; myVar2 = 1000; // After this myVar1 contains 1100, myVar2 is unchanged myVar1 += myVar2;