List of all binary operators in JavaScript
You will find a complete list in the specification, in the expression chapter. Because the most "normal" operators are binary (see the definition at Wikipedia), they are not explicitly listed as such (like the unary and ternary operators). They are:
- Multiplicative Operators
- The
*
Operator - The
/
Operator - The
%
Operator
- The
- Additive Operators
- The Addition operator (
+
) - The Subtraction Operator (
-
)
- The Addition operator (
- Bitwise Shift Operators
- The Left Shift Operator (
<<
) - The Signed Right Shift Operator (
>>
) - The Unsigned Right Shift Operator (
>>>
)
- The Left Shift Operator (
- Relational Operators
- The Less-than Operator (
<
) - The Greater-than Operator (
>
) - The Less-than-or-equal Operator (
<=
) - The Greater-than-or-equal Operator (
>=
) - The
instanceof
operator - The
in
operator
- The Less-than Operator (
- Equality Operators
- The Equals Operator (
==
) - The Does-not-equals Operator (
!=
) - The Strict Equals Operator (
===
) - The Strict Does-not-equal Operator (
!==
)
- The Equals Operator (
- Binary Bitwise Operators (
&
,^
,|
) - Binary Logical Operators (
&&
,||
)
Technically speaking, also the assignment and comma operators are binary.
There are the following arithmetic operators supported by the JavaScript language.
Assume variable A holds 10 and variable B holds 20 then:
Here is the original page link.