JavaScript falsy objects and comparisons
Very spooky stuff

In JavaScript you will find yourself scrapping your head around comparisons and perplexed about how expressions evaluate to true or false. This is because JavaScript uses truthy and falsy expressions to evaluate comparisons.
Falsy objects (meet the family)
- empty string
- the number zero
- null
- NaN
- the boolean false
- undefined
Truthy objects are just anything else but the list above. Basically any object that is initialised with any value different from the list above, is truthy.
Take care when using the empty string or 0 as a valid parameter as they might be ignored by some APIs if they precede their code with if (!parameter) return;
Comparisons
JavaScript evaluates comparisons from left to right. This is for efficiency so as soon as there is a reason to stop evaluating expressions JavaScript will do so.
As a general rule OR comparisons will stop as soon as a truthy expression is evaluated. On the other hand, AND comparisons will stop as soon as a falsy expression is evaluated.

