# Bit - Bitwise and Shift binary operator

> (Data|State) Management and Processing > (Data Type|Data Structure) > Number, Numeric, Quantity > Bit - Binary Number

### Table of Contents

## 1 - About

See Reference/Operators/Bitwise_Operators

Bitwise binary operator may also be used as assignment operator

## 2 - Articles Related

Advertising

## 3 - Type

- the bitwise arithmetic operators (
`~`

,`&`

,`^`

, and`|`

) - and the shift operators (
`<<`

,`>>`

, and`>>>`

).

### 3.1 - Arithmetic

#### 3.1.1 - XOR (^)

The bitwise XOR expression follows the following rules:

0 ^ 0 = 0 0 ^ 1 = 1 1 ^ 0 = 1 1 ^ 1 = 0

#### 3.1.2 - OR (|)

The bitwise OR expression follows the following rules:

0 | 0 = 0 0 | 1 = 1 1 | 0 = 1 1 | 1 = 1

Example:

console.log(6 | 2); // 6 console.log(8 | 1); // 9

Advertising

#### 3.1.3 - AND (&)

0 & 0 = 0 0 & 1 = 0 1 & 0 = 0 1 & 1 = 1

### 3.2 - Shift

the shift operators (`<<`

, `>>`

, and `>>>`

).