Operators Table
Listed in order of decreasing precedence levels:
| Precedence | Operator | Type | Associativity |
|---|---|---|---|
| 1 (Highest) | ., [] |
Property access, indexing | Left to Right |
| 2 | ++, --, ~, not, unary +, - |
Increment, Decrement, Bitwise NOT, Logical NOT, Unary plus/minus | Right to Left |
| 3 | ** |
Exponentiation | Right to Left |
| 4 | *, /, //, % |
Multiplicative calculations | Left to Right |
| 5 | +, - |
Additive calculations | Left to Right |
| 6 | <<, >> |
Bitwise shift | Left to Right |
| 7 | &, |, ^ |
Bitwise calculations | Left to Right |
| 8 | .., to |
Range generator | Left to Right |
| 9 | ==, !=, <, >, <=, >= |
Relational comparison | Left to Right |
| 10 | in, not in, is, instanceof |
Membership, identity checks | Left to Right |
| 11 | and, or |
Logical AND, Logical OR | Left to Right |
| 12 (Lowest) | =, +=, -=, *=, /=, //=, **=, %=, &=, |=, ^=, <<=, >>= |
Assignment | Right to Left |