Last active
October 27, 2022 21:53
-
-
Save tevashov/5172443 to your computer and use it in GitHub Desktop.
How to: TRUE and FALSE evaluating #JS
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
| // TRUE | |
| '0'; | |
| 'any string'; | |
| []; // an empty array | |
| {}; // an empty object | |
| 1; // any non-zero number | |
| // FALSE | |
| 0; | |
| ''; // an empty string | |
| NaN; // JavaScript's "not-a-number" variable | |
| null; | |
| undefined; // be careful -- undefined can be redefined! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment