<p>I'm someone who writes code just for fun and haven't really delved into it in either an academic or professional setting, so stuff like these bitwise operators really escapes me.</p>

<p>I was reading an article about JavaScript, which apparently supports bitwise operations. I keep seeing this operation mentioned in places, and I've tried reading about to figure out what exactly it is, but I just don't seem to get it at all. So what are they? Clear examples would be great! :D</p>

<p>Just a few more questions - what are some practical applications of bitwise operations? When might you use them?</p>

These are the bitwise operators, all supported in JavaScript:
```
op1 & op2
```
-- The
```
AND
```
operator compares two bits and generates a result of 1 if both bits are 1; otherwise, it returns 0.
```
op1 | op2
```
-- The
```
OR
```
operator compares two bits and generates a result of 1 if the bits are complementary; otherwise, it returns 0.
```
op1 ^ op2
```
-- The
```
EXCLUSIVE-OR
```
operator compares two bits and returns 1 if either of the bits are 1 and it gives 0 if both bits are 0 or 1.
```
~op1
```
-- The
```
COMPLEMENT
```
operator is used to invert all of the bits of the operand.
```
op1 << op2
```
-- The
```
SHIFT LEFT
```
operator moves the bits to the left, discards the far left bit, and assigns the rightmost bit a value of 0. Each move to the left effectively multiplies op1 by 2.
```
op1 >> op2
```
-- The
```
SHIFT RIGHT
```
operator moves the bits to the right, discards the far right bit, and assigns the leftmost bit a value of 0. Each move to the right effectively divides op1 in half.  The left-most sign bit is preserved.
```
op1 >>> op2
```
-- The
```
SHIFT RIGHT
```
-
```
ZERO FILL
```
operator moves the bits to the right, discards the far right bit, and assigns the leftmost bit a value of 0. Each move to the right effectively divides op1 in half.  The left-most sign bit is discarded.