JS: Bitwise Operators

By Xah Lee. Date: . Last updated: .
bitwise logic operators
~bitwise NOT.
&bitwise AND.
|bitwise OR.
^bitwise XOR.
bitwise shift operators
<<bitwise left shift.
>>bitwise right shift.
>>>bitwise 0-padded right shift.

Bitwise NOT

~

ECMAScript 2015 §ECMAScript Language: Expressions#sec-bitwise-not-operator

ES5 §11#sec-11.4.8

Bitwise AND

&

ECMAScript 2015 §ECMAScript Language: Expressions#sec-binary-bitwise-operators

Bitwise OR

|

ECMAScript 2015 §ECMAScript Language: Expressions#sec-binary-bitwise-operators

Bitwise XOR

^

ECMAScript 2015 §ECMAScript Language: Expressions#sec-binary-bitwise-operators

Left Shift Operator

<<

ECMAScript 2015 §ECMAScript Language: Expressions#sec-left-shift-operator

ECMAScript 5.1 §11#sec-11.7.1

Signed Right Shift Operator

>>

ECMAScript 2015 §ECMAScript Language: Expressions#sec-signed-right-shift-operator

Unsigned Right Shift Operator

>>>

ECMAScript 2015 §ECMAScript Language: Expressions#sec-unsigned-right-shift-operator

Liket it? Put $5 at patreon.

Or, Buy JavaScript in Depth

If you have a question, put $5 at patreon and message me.