Binary operators require two operands and with them form an expression. The operator determines the kind of expression.
Here is a list of the binary operators supported by JavaScript:
| Operator | Description |
| != | NOT equal to |
| % | Remainder |
| %= | Remainder and assign to an LValue |
| & | Bitwise AND |
| && | Logical AND |
| &= | Bitwise AND and assign to an LValue |
| * | Multiply |
| *= | Multiply and assign to an LValue |
| + | Add |
| + | Concatenate string |
| += | Add and assign to an LValue |
| - | Subtract |
| -= | Subtract and assign to an LValue |
| / | Divide |
| /= | Divide and assign to an LValue |
| < | Less than |
| << | Bitwise left shift |
| <<= | Bitwise shift left and assign to an LValue |
| <= | Less than or equal to |
| = | Simple assignment to an LValue |
| == | Equal to |
| > | Greater than |
| >= | Greater than or equal to |
| >> | Bitwise shift right |
| >>= | Bitwise shift right and assign to an LValue |
| >>> | Bitwise shift right (unsigned) |
| >>>= | Bitwise shift right (unsigned) and assign to an LValue |
| ^ | Bitwise XOR (exclusive OR) |
| ^= | Bitwise exclusive XOR and assign to an LValue |
| | | Bitwise inclusive OR |
| |= | Bitwise inclusive OR and assign to an LValue |
| || | Logical OR |
| See also: | Multiplicative operator, Operator, Ternary operator |
ECMA 262 edition 2 - section - 11.5
ECMA 262 edition 3 - section - 11.6
ECMA 262 edition 3 - section - 11.7
ECMA 262 edition 3 - section - 11.8
ECMA 262 edition 3 - section - 11.9
ECMA 262 edition 3 - section - 11.10
ECMA 262 edition 3 - section - 11.11
ECMA 262 edition 3 - section - 11.13
| Prev | Home | Next |
| Binary logical operator | Up | Binding |
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. | ||