๐งtable of operators
๐ง under construction -> fix table precedence
Last updated
Was this helpful?
๐ง under construction -> fix table precedence
Last updated
Was this helpful?
Was this helpful?
JS โฉ statement โฉ expression โฉ operator โฉ table of operators
P๏ผprecedence, A๏ผassociation, N๏ผnumber of operands (arity)
lval๏ผ, n๏ผ, s๏ผstr, i๏ผint, o๏ผobj, f๏ผfunc, b๏ผbool, a๏ผany
( ... )
obj . prop
obj [ prop ]
with argument list
f ( args )
obj ?. prop
without argument list
++
post-increment
--
post-decrement
!
logical not
bool -> bool
bitwise not (invert bits)
int -> int
unary + (convert to number)
any -> num
-
unary - (negative)
num -> num
++
pre-increment
lval -> num
--
pre-decrement
lval -> num
type of operand
any -> str
delete a property
lval -> bool
return undefined
any -> undef
(n, n) -> n
*, /, %
multiply, divide, remainder
(n, n) -> n
+
, -
add, substract
(n, n) -> n
concatenate strings
(s, s) -> s
<<
shift left
(i, i) -> i
>>
shift right (sign extension)
(i, i) -> i
>>>
shift right (0 extension)
(i, i) -> i
< <= > >=
compare (number)
(n, n) -> b
< <= > >=
compare (string)
(s, s) -> b
test object class
(o, f) -> b
test property existence
(a, o) -> b
(a, a) -> b
!=
not equal (sloppy)
(a, a) -> b
(a, a) -> b
!==
not equal (strict)
(a, a) -> b
&
bitwise AND
(i, i) -> i
^
bitwise XOR
(i, i) -> i
|
bitwise OR
(i, i) -> i
&&
logical AND
(a, a) -> a
||
logical OR
(a, a) -> a
(a, a) -> a
(b, a, a) -> a
(lval, a) -> a
**= *= /= %= += -= &= ^= |= <<= >>= >>>=
operate/assign
(lval, a) -> a
(a, a) -> a