Precedence refers to the order in which operators are applied when evaluating an expression. Operator precedence can be overridden by using parentheses. The following list gives the order of precedence, starting with the highest.
The following table describes the precedence of operators, from highest to lowest.
Operator type |
Individual operators |
|
| highest: | member | . [] |
| create instance | new | |
| call | () | |
| negation/increment | ! ~ - + ++ -- typeof void delete | |
| multiply/divide | * / % | |
| addition/subtraction | + - | |
| bitwise shift | << >> >>> | |
| relational | < <= > >= | |
| equality | == != | |
| bitwise-and | & | |
| bitwise-xor | ^ | |
| bitwise-or | | | |
| logical-and | && | |
| logical-or | || | |
| conditional | ?: | |
| assignment | = += -= *= /= %= <<= >>= >>>= &= ^= |= | |
| lowest: | comma | , |
Back to top Home Serious Stuff
© 2001. Copyright Sue Nethercott.