Operators (JavaScript)

Operators fall into the following categories:

This is a 2-column table. The first column has links to topics about operators. The second column lists the operators described in the topic in the first column.

Operators Description
Assignment operators (JavaScript) = += -= *= /= %=&= |= ^= <<= >>= >>>=
Comparison operators (JavaScript) == != === !== > >=< <=
Arithmetic operators (JavaScript) + - * / % ++ (post-increment) ++ (pre-increment) -- (post-decrement) -- (pre-decrement) - (negation) + (unary plus)
Bitwise operators (JavaScript) & | ~ ^ << >> >>>
Logical operators (JavaScript) && || !
String operators (JavaScript) + +=
List operators (JavaScript) + - * /
Special operators (JavaScript) ?: , delete function new this typeof void . []
The following table lists operator precedence and associativity. Operators with lower precedence evaluate first left-to-right or right-to-left as listed. Parentheses can be used to change the order of evaluation; parenthesized expressions are evaluated first inner to outer.

This is a 3-column table with precedence in the first column, the operators of that precedence in the second column, and associativity in the third column.

Precedence Operator Associativity
1 . [] left-to-right
new right-to-left
2 () left-to-right
3 ++ -- not applicable
4 ! ~ - (negation) + (unary plus) typeof void delete right-to-left
5 * / % left-to-right
6 + - left-to-right
7 << >> >>> left-to-right
8 > >=< <= left-to-right
9 == != === !== left-to-right
10 & left-to-right
11 ^ left-to-right
12 | left-to-right
13 && left-to-right
14 || left-to-right
15 ?: right-to-left
16 = += -= *= /= %=&= |= ^= <<= >>= >>>= right-to-left
17 , left-to-right