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

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

Answer: 
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>
one more point i want to add is || operator is used to assign default value in case the value you are assigning is undefined. So for Exapmle you are assigning a obj to some object test and if you dont want test to be undefined then you can do the following to ensure that value of test wont be undefined.

var test = obj || {};

so in case obj is undefined then test's value will be empty object.

So it is also being used for assigning default value to your object.