JS Boolean Coercion

Boolean coercion: In javascript coercion, all values are converted to true except for the following values which are coerced to false:

1
2
3
4
5
6
console.log(!!"");         // false
console.log(!!0); // false
console.log(!!null); // false
console.log(!!undefined); // false
console.log(!!NaN); // false
console.log(!!false); // false

References