Assignment operators
Assignment operators
Assignment and compound assignment operators are binary operators that modify the variable to their left using the value to their right.
Operator | Operator name | Example | Description | Equivalent of |
---|---|---|---|---|
= | basic assignment | a = b | a becomes equal to b | N/A |
+= | addition assignment | a += b | a becomes equal to the addition of a and b | a = a + b |
-= | subtraction assignment | a -= b | a becomes equa
|