Skip to content

Instantly share code, notes, and snippets.

@eliperelman
Created July 6, 2011 02:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eliperelman/1066462 to your computer and use it in GitHub Desktop.
Save eliperelman/1066462 to your computer and use it in GitHub Desktop.
Falsy Values
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