JavaScript expressions and basic operators are similar to C PERL and Java
|
Assignment Operators are = += -= *= /= %= <<= >>= >>>= &= ^= |=
-
with x += y; meaning x= x + y;
-
and x %= y; meaning x = x%y; // x mod(y)
|
Conditional Expressions
-
status = (age >= 18) ? "adult" : "minor"; // sets status to be "adult" if age is larger than or equal to 18. Otherwise it is set to "minor"
|
Arithmetic operators are as usual with in addition ++ and --
-
y = ++x; // increments x by 1 and sets y to be final value of x
|