RSS

Monthly Archives: September 2012

Values regarded as conditional false in Javascript

These values are treated as false in conditional statements, all other values including the string ‘false’ are treated as true:

Value Type
0 Number
NaN Number
”(empty string) String
false Boolean
null Object
undefined Undefined

For example, the code below will alert “NaN is falsy”: Read the rest of this entry »

 
Leave a comment

Posted by on September 13, 2012 in Javascript, jQuery