# Truthy and Falsy

There are six values that are considered to be falsy in JavaScript.

0; //the number zero
false; //the Boolean false value
(""); //an empty string
null; // a variable that is intentionally set to empty
undefined; // a variable that has been declared but not assigned a value yet
NaN; // Not a Number - the result of Mathematic operations when a non-numeric input was provided
1
2
3
4
5
6

EVERYTHING else in JavaScript is considered to be truthy. And I mean EVERYTHING.

Back to Week 2 main page

Last Updated: 6/13/2020, 11:30:19 PM