Truthy & Falsy
if(true) alert("truthy"); if(42) alert("truthy"); if("hello world") alert("truthy");
In general, all values that are either null, undefined or empty will be considered as Falsy and therefore be treated as false, when used in a boolean context like loops and if statements. Here's a couple of examples:
if(false) alert("falsy"); if(null) alert("falsy"); if(0) alert("falsy"); if("") alert("falsy");
If you run this sample, you will notice that none of the alerts are triggered - all of the above if statements will be considered as false in this context.