Created
July 6, 2011 02:59
-
-
Save eliperelman/1066462 to your computer and use it in GitHub Desktop.
Falsy Values
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var falsies = [ false, 0, '', null, undefined, NaN ]; | |
for (var i = 0, len = falsies.length; i < len; i++) { | |
if (falsies[i]) { | |
// this will never hit | |
} else { | |
// this will always be hit | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment