The following table lists the JavaScript operators, sorted from highest to lowest in order of precedence. operators that have the same precedence are evaluated in order from left to right.
Operator |
Description |
. [ ] ( ) |
field access, array index, function call, and expression grouping |
++ -- - ~ ! Delete new typeof void |
Unary operators, return data types, object creation, undefined values |
* / % |
Multiply, divide, and find the remainder |
+ - + |
Add, subtract, string concatenation |
<< >> >>> |
Shift |
< <= > >= instanceof |
Less than, less than or equal to, greater than, greater than or equal to, or not an instance of a particular class |
== != === !== |
Equality, inequality, equality, not congruent |
& |
Bitwise "and" |
^ |
Bitwise XOR |
| |
Bitwise "OR" |
&& |
Logical "and" |
|| |
Logical "or" |
?: |
Conditional operations |
= OP= |
Assignment, assignment operations (e.g. + = and &=) |
, |
Multiple calculations |
Parentheses are used to change the order of calculation determined by the operator precedence. This means that the expression inside the parentheses is evaluated before the value is used for the remainder of the expression.
JavaScript Operator Precedence