Which values are falsy in JavaScript?
Quick answer
false, 0, -0, 0n, "" (empty string), null, undefined and NaN. Everything else is truthy.
In detail
There are exactly eight falsy values. Notably '0', 'false', [], and {} are all truthy — so to check an empty array you must test `arr.length`, not the array itself. This drives every `if`, `||` default and `&&` guard.
if ("0") {} // runs — non-empty string is truthy
if ([]) {} // runs — [] is truthy!
if (arr.length) {} // correct empty-array check⚠️Gotcha
[] and {} are truthy; if (myArray) is always true even when empty.
Why interviewers ask this: Truthiness governs conditionals and default values.
This is 1 of 118+ questions in the JavaScript Interview Kit
Get every question with detailed answers, follow-ups and real code — plus coding challenges and a last-minute revision sheet. One-time payment, instant access.
⚡ Get the JavaScript Interview Kit → ₹299