JavaScript provides the normal assignment operator and arithmetic assignment operators that provide shortcuts for common arithmetic operators.
|
Operator |
Example |
Equivalent |
|---|---|---|
|
= |
a = b |
|
|
+= |
a += b |
a = a + b |
|
-= |
a -= b |
a = a - b |
|
*= |
a *= b |
a = a * b |
|
/= |
a /= b |
a = a / b |
|
%= |
a %= b |
a = a % b |
|
Copyright © 2014 CA.
All rights reserved.
|
|