Created
April 18, 2015 13:32
-
-
Save lorenzoongithub/74607f7e7c8c13581f11 to your computer and use it in GitHub Desktop.
falsy values
This file contains hidden or 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
// | |
// 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