null, the integer
'' (the empty string) and
undefined are evaluated as
false inside an
if statement. What's a bit more curious is the following behaviour (try it the firebug console):
false == 0; // -> true false == ''; // -> true false == undefined; // -> false false == null; // -> false
If anyone has a rationale explanation to this, please share.