JavaScript For Java Developers

Truthy and Falsy values.

JavaScript developers often toss around the terms "truthy" and "falsy", but for those who are newer to JavaScript these terms can be a bit mystifying.

Definition:

Truthy: Something which evaluates to true.
Falsey: Something which evaluates to false.

if ( var ) { 
         // would be executed for Truthy values 
} else {
         // would be executed for Falsey values
}
List of all Falsey values in JavaScript (all other values would be treated as Truthy).
false
0
-0
""
''
null
undefined
NaN

Set of the problems:

Links to read: