The operators below are listed in descending order or precedence. The associativity column indicates the direction (left-to-right or right-to-left) in which items are evaluated.
Operator | Description | Assoc |
---|---|---|
() | Grouping operator | L-R |
[] | Array index delimiter | L-R |
. | Property accessor | L-R |
++ | Postfix increment | L-R |
-- | Postfix decrement | L-R |
! | Logical NOT | R-L |
~ | Bitwise NOT | R-L |
++ | Prefix increment | R-L |
-- | Prefix decrement | R-L |
- | Negate operand | L-R |
delete | Delete a property from an object | R-L |
new | Invokes an object constructor | R-L |
typeof | Determines the type of a value | R-L |
void | Always yields the undefined value | R-L |
* | Multiply | L-R |
/ | Divide | L-R |
% | Remainder | L-R |
+ | Convert the operand to a numeric value | L-R |
+ | Add | L-R |
- | Subtract | L-R |
+ | Concatenate string | L-R |
<< | Bitwise shift left | L-R |
>> | Bitwise shift right | L-R |
>>> | Bitwise shift right (unsigned) | L-R |
< | Compare less than | L-R |
<= | Compare less than or equal to | L-R |
> | Compare greater than | L-R |
>= | Compare greater than or equal to | L-R |
in | Property is in object | L-R |
instanceof | Object is instance of another object | L-R |
== | Compare equal to | L-R |
!= | Compare NOT equal to | L-R |
=== | Compare identically equal to | L-R |
!== | Compare identically NOT equal to | L-R |
& | Bitwise AND | L-R |
^ | Bitwise XOR | L-R |
| | Bitwise OR | L-R |
&& | Logical AND | L-R |
|| | Logical OR | L-R |
?: | Conditional execution | R-L |
= | Assign | R-L |
*= | Multiply and assign | R-L |
/= | Divide and assign | R-L |
%= | Remainder and assign | R-L |
+= | Add and assign | R-L |
-= | Subtract and assign | R-L |
<<= | Bitwise shift left and assign | R-L |
>>= | Bitwise shift right and assign | R-L |
>>>= | Bitwise shift right (unsigned) and assign | R-L |
&= | Bitwise AND and assign | R-L |
|= | Bitwise inclusive OR and assign | R-L |
^= | Bitwise XOR and assign | R-L |
, | Argument delimiter | L-R |
; | Empty statement | L-R |
{ } | Delimit code block | L-R |
Prev | Home | Next |
Operator | Up | OptGroupElement object |
JavaScript Programmer's Reference, Cliff Wootton Wrox Press (www.wrox.com) Join the Wrox JavaScript forum at p2p.wrox.com Please report problems to support@wrox.com © 2001 Wrox Press. All Rights Reserved. Terms and conditions. |