Mid JavaScript

What are the falsy values in JavaScript?

Values that evaluate to false in Boolean context:

false, 0, "", null, undefined, NaN

Example:

if (!0) console.log("Falsy"); // prints "Falsy"

More from JavaScript Tutorial

All questions for this course