Question: What's the difference between `|` and `||` in Javascript?

Furthermore, what's the difference between `&` and `&&`?

Answer: 
`|` is a bitwise or, `||` is a logical or. 

A bitwise or takes the two numbers and compares them on a bit-by-bit basis, producing a new integer which combines the 1 bits from both inputs. So `0101 | 1010` would produce `1111`. 

A logical or `||` checks for the "truthiness" of a value (depends on the type, for integers 0 is false and non-zero is true). It evaluates the statement left to right, and returns the first value which is truthy. So `0101 || 1010` would return `0101` which is truthy, therefore the whole statement is said to be true.

The same type of logic applies for `&` vs `&&`. `0101 & 1010` = `0000`. However `0101 && 1010` evaluates to `1010` (`&&` returns the last truthy value so long as both operands are truthy).
To explain a little more in layman's terms:

`&&` and `||` are *logical* operators. This means they're used for logical comparison;

```
if (a == 4 && b == 5)

```

This means "If a equals to four AND b equals to five"

`|` and `&` are *bitwise* operators. They operate on bits in a specific fashion which the wiki article explains in detail:

<http://en.wikipedia.org/wiki/Bitwise_operation>