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

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

Answer: 
In Javascript perspective, there is more to it.

```
var a = 42;
var b = "abc";
var c = null;

a || b;     // 42
a && b;     // "abc"

c || b;     // "abc"
c && b;     // null

```

Both || and && operators perform a boolean test on the first operand (a or c). If the operand is not already boolean (as it's not, here), a normal ToBoolean coercion occurs, so that the test can be performed.

For the || operator, if the test is true, the || expression results in the value of the first operand (a or c). If the test is false, the || expression results in the value of the second operand (b).

Inversely, for the && operator, if the test is true, the && expression results in the value of the second operand (b). If the test is false, the && expression results in the value of the first operand (a or c).

The result of a || or && expression is always the underlying value of one of the operands, not the (possibly coerced) result of the test. In c && b, c is null, and thus falsy. But the && expression itself results in null (the value in c), not in the coerced false used in the test.
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.