Truthy & Falsy Playground

Bayu’s counter: hand over any value, the browser decides whether it is taken. Only 8 values are falsy. An interactive Truthy & Falsy playground: change the…

Why it matters

The subtlest JavaScript bugs often come from here. if (count) fails when count is 0, if (arr) always passes even when the array is empty, and x || fallback overwrites a real 0 or empty text. Learn the 8 falsy values and you never have to guess again.

The key idea

Only 8 values are falsy; everything else is truthy

Common mistakes

Try it in this playground