๐Ÿšงtable of operators

๐Ÿšง under construction -> fix table precedence

JS โŸฉ statement โŸฉ expression โŸฉ operator โŸฉ table of operators

property access and invocation expressions have higher precedence than any of the operators.

  • P๏ผšprecedence, A๏ผšassociation, N๏ผšnumber of operands (arity)

  • lval๏ผšlvalue, n๏ผšnum, s๏ผšstr, i๏ผšint, o๏ผšobj, f๏ผšfunc, b๏ผšbool, a๏ผšany

P
Operator
Operation
A
N
Types
18

( ... )

๐Ÿˆš
null

17

obj . prop

L
null

null

obj [ prop ]

๐Ÿˆš
null

null

with argument list

๐Ÿˆš
null

null

f ( args )

๐Ÿˆš
null

null

obj ?. prop

L
null

16

without argument list

๐Ÿˆš
null

15

++

post-increment

๐Ÿˆš
null

null

--

post-decrement

๐Ÿˆš
null

14

!

๐Ÿˆš
1

bool -> bool

0
๐Ÿˆš
1

int -> int

0
๐Ÿˆš
1

any -> num

0

-

unary - (negative)

๐Ÿˆš
1

num -> num

0

++

pre-increment

๐Ÿˆš
1
0

--

pre-decrement

๐Ÿˆš
1
0
๐Ÿˆš
1

any -> str

0
๐Ÿˆš
1
0
๐Ÿˆš
1

any -> undef

null

๐Ÿˆš
null

13
R
2

(n, n) -> n

null
L
2

(n, n) -> n

0
L
2

(n, n) -> n

0
L
2

(s, s) -> s

0

<<

shift left

L
2

(i, i) -> i

0

>>

shift right (sign extension)

L
2

(i, i) -> i

0

>>>

shift right (0 extension)

L
2

(i, i) -> i

0

< <= > >=

L
2

(n, n) -> b

0

< <= > >=

L
2

(s, s) -> b

0

test object class

L
2

(o, f) -> b

0

test property existence

L
2

(a, o) -> b

0
L
2

(a, a) -> b

0

!=

not equal (sloppy)

L
2

(a, a) -> b

0
L
2

(a, a) -> b

0

!==

not equal (strict)

L
2

(a, a) -> b

0

&

bitwise AND

L
2

(i, i) -> i

0

^

bitwise XOR

L
2

(i, i) -> i

0

|

bitwise OR

L
2

(i, i) -> i

0

&&

L
2

(a, a) -> a

0

||

L
2

(a, a) -> a

0
L
2

(a, a) -> a

0
R
3

(b, a, a) -> a

0
R
2
0

**= *= /= %= += -= &= ^= |= <<= >>= >>>=

operate/assign

R
2
0
L
2

(a, a) -> a

Last updated