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

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

Answer: 
* `&` is [the bitwise AND operator](http://rx4ajax-jscore.com/resource/glossary/glossb.html#bitwise_and_operator)
* `|` is [the bitwise OR operator](http://rx4ajax-jscore.com/resource/glossary/glossb.html#bitwise_or_operator)
* `&&` is [the logical AND operator](http://www.devguru.com/technologies/ecmascript/quickref/logical_operators.html)
* `||` is [the logical OR operator](http://www.devguru.com/technologies/ecmascript/quickref/logical_operators.html)

The difference is that logical operators only consider each input at face value, treating them as whole, while [bitwise operators work at the bit level](http://en.wikipedia.org/wiki/Bitwise_operation):

```
var thetruth = false;
var therest = true;

var theuniverse = thetruth && therest; //false
var theparallel = thetruth && thetruth; //true

var theindifferent = thetruth || therest; //true
var theideal = thetruth || thetruth; // false

var thematrix = 5346908590;
var mrsmith = 2354656767;

var theoracle = thematrix & mrsmith; //202445230
var theone = thematrix | mrsmith; //7499120127

```
Another difference is that `||` uses shortcut evaluation. That is, it only evaluates the right side if the left side is `false` (or gets converted to false in a boolean context, e.g. `0`, `""`, `null`, etc.). Similarly, `&&` only evaluates the right side if the left side is `true` (or non-zero, non-empty string, an object, etc.). `|` and `&` always evaluate both sides because the result depends on the exact bits in each value.

The reasoning is that for `||`, if either side is true, the whole expression is true, so there's no need to evaluate any further. `&&` is the same but reversed.

The exact logic for `||` is that if the left hand side is "truthy", return that value (note that it is **not converted to a boolean**), otherwise, evaluate and return the right hand side. For `&&`, if the left hand side is "falsey", return it, otherwise evaluate and return the right hand side.

Here are some examples:

```
false && console.log("Nothing happens here");
true || console.log("Or here");
false || console.log("This DOES get logged");
"foo" && console.log("So does this");

if (obj && obj.property) // make sure obj is not null before accessing a property

```