Binary operator (Definition)

An operator that works with two operands.

Availability:

ECMAScript edition - 2
Property/method value type:Boolean primitive

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:

OperatorDescription
!=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

Cross-references:

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