Operator Precedence Table
Precedence | Expression |
---|---|
15: postfix operators | x++; x-- |
14: prefix operators | ++x; --x; !x; ~x; +x; -x |
13: exponentiation | x**y |
12: multiplicative operators | x*y; x/y; x%y |
11: additive operators | x+y; x-y |
10: bitwise shift | x<<y; x>>y; x>>>y |
9: relational operators | x<y; x<=y; x>y; x>=y |
8: equality operators | x==y; x!=y; x===y; x!==y |
7: bitwise AND | x&y |
6: bitwise XOR | x^y |
5: bitwise OR | x|y |
4: logical AND | x&&y |
3: logical OR, nullish coalescing | x||y; x??y |
2: assignment and miscellaneous | x=y; x+=y; x-=y; x**=y; x*=y; x/=y; x%=y;x<<=y; x>>=y; x>>>=y; x^=y; x|=y; x&&=y; x||=y; x??=y; x?y:z; x=>y |
1: comma | x,y |