🚧table of operators

🚧 under construction -> fix table precedence

JSstatementexpressionoperator ⟩ table of operators

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

  • Pprecedence, Aassociation, Nnumber of operands (arity)

  • lvallvalue, n:num, s:str, i:int, o:obj, f:func, b:bool, aany

POperatorOperationANTypes
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

bitwise not (invert bits)

🈚
1

int -> int

0

unary + (convert to number)

🈚
1

any -> num

0

-

unary - (negative)

🈚
1

num -> num

0

++

pre-increment

🈚
1

lval -> num

0

--

pre-decrement

🈚
1

lval -> num

0

type of operand

🈚
1

any -> str

0

delete a property

🈚
1

lval -> bool

0

return undefined

🈚
1

any -> undef

null

🈚
null

13
R
2

(n, n) -> n

null

*, /, %

multiply, divide, remainder

L
2

(n, n) -> n

0

+, -

add, substract

L
2

(n, n) -> n

0

concatenate strings

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

< <= > >=

compare (number)

L
2

(n, n) -> b

0

< <= > >=

compare (string)

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

(lval, a) -> a

0

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

operate/assign

R
2

(lval, a) -> a

0
L
2

(a, a) -> a

Last updated