| Precedence | Group | Operator | Desription | Associativity |
|---|---|---|---|---|
| 18 | Grouping | (x) |
Grouping, [1] | |
| 17 | Access and call | x.y |
Member access, [2] | left-to-right |
x?.y |
Optional chaining, [2] | |||
x[y] |
Computed member access, [3] | |||
new x(y) |
new with argument list, [4] |
|||
x(y) |
Function call, [4] | |||
import(x) |
import(), [4] | |||
| 16 | New | new x |
new without argument list |
|
| 15 | Postfix operators | x++ |
Postfix increment, [5] | |
x-- |
Postfix decrement, [5] | |||
| 14 | Prefix operators | ++x |
Prefix increment, [6] | |
--x |
Prefix decrement, [6] | |||
!x |
Logical NOT | |||
~x |
Bitwise NOT | |||
+x |
Unary plus | |||
-x |
Unary negation | |||
typeof x |
typeof | |||
void x |
void | |||
delete x |
delete, [7] | |||
await x |
await | |||
| 13 | Exponentiation | x ** y |
Exponentiation, [8] | right-to-left |
| 12 | Multiplicative operators | x * y |
Multiplication | left-to-right |
x / y |
Division | |||
x % y |
Remainder | |||
| 11 | Additive operators | x + y |
Addition | left-to-right |
x - y |
Subtraction | |||
| 10 | Bitwise shift | x << y |
Left shift | left-to-right |
x >> y |
Right shift | |||
x >>> y |
Unsigned right shift | |||
| 9 | Relational operators | x < y |
Less than | left-to-right |
x <= y |
Less than or equal | |||
x > y |
Greater than | |||
x >= y |
Greater than or equal | |||
x in y |
in | |||
x instanceof y |
instanceof | |||
| 8 | Equality operators | x == y |
Equality | left-to-right |
x != y |
Inequality | |||
x === y |
Strict equality | |||
x !== y |
Strict inequality | |||
| 7 | Bitwise operators | x & y |
Bitwise AND | left-to-right |
| 6 | x ^ y |
Bitwise XOR | ||
| 5 | x | y |
Bitwise OR | ||
| 4 | Logical operators | x && y |
Logical AND | left-to-right |
| 3 | x || y |
Logical OR | ||
x ?? y |
Nullish coalescing operator, [9] | |||
| 2 | Assignment | x = y |
Assignment, [10] | right-to-left |
x += y |
Addition assignment, [10] | |||
x -= y |
Subtraction assignment, [10] | |||
x **= y |
Exponentiation assignment, [10] | |||
x *= y |
Multiplication assignment, [10] | |||
x /= y |
Division assignment, [10] | |||
x %= y |
Remainder assignment, [10] | |||
x <<= y |
Left shift assignment, [10] | |||
x >>= y |
Right shift assignment, [10] | |||
x >>>= y |
Unsigned right shift assignment, [10] | |||
x &= y |
Bitwise AND assignment, [10] | |||
x ^= y |
Bitwise XOR assignment, [10] | |||
x |= y |
Bitwise OR assignment, [10] | |||
x &&= y |
Logical AND assignment, [10] | |||
x ||= y |
Logical OR assignment, [10] | |||
x ??= y |
Nullish coalescing assignment, [10] | |||
| Miscellaneous | x ? y : z |
Conditional (ternary) operator, [11] | right-to-left | |
x => y |
Arrow, [12] | right-to-left | ||
yield x |
yield | |||
yield* x |
yield* | |||
...x |
Spread, [13] | |||
| 1 | Comma | x, y |
Comma operator | left-to-right |
Notes:
new Foo++ is (new Foo)++ (a syntax error) and not new (Foo++) (a TypeError: (Foo++) is not a constructor).||) or logical AND (&&) operator without grouping.? are implicitly grouped.