Truthiness Concept
Concept Check Medium
Question
Which of the following values is falsy in JavaScript?
Hint
Falsy values are: false, 0, '', null, undefined, NaN.
Explanation
In JavaScript, the falsy values are: false, 0, -0, 0n, "", null, undefined, NaN. Everything else is truthy. 0 is falsy. But "false" (a non-empty string), [] (an empty array), and "0" (a non-empty string) are all truthy. This is a common source of bugs.
Related Resources
Related Lessons
- Boolean Logic
Learn about boolean logic and operators.
Look up unfamiliar terms
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.
Build real projects
Apply what you learned by building guided projects with starter code and solutions.