Skip to content

Instantly share code, notes, and snippets.

@lorenzoongithub
Created April 18, 2015 13:32
Show Gist options
  • Save lorenzoongithub/74607f7e7c8c13581f11 to your computer and use it in GitHub Desktop.
Save lorenzoongithub/74607f7e7c8c13581f11 to your computer and use it in GitHub Desktop.
falsy values
//
// A falsy value is a value that translates to false when evaluated in a Boolean context.
// see: https://developer.mozilla.org/en-US/docs/Glossary/Falsy
//
if (false) throw '';
if (null) throw '';
if (undefined) throw '';
if (0) throw '';
if (NaN) throw '';
if ('') throw '';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment