JavaScript7 min read
JavaScript Truthy and Falsy Values
Understand truthy and falsy values in JavaScript. Learn which values are considered true/false.
Alex Thompson
December 19, 2025
0.0k0
JavaScript Truthy and Falsy
Falsy Values
These are considered false:
false
0
'' (empty string)
null
undefined
NaN
Truthy Values
Everything else is truthy:
true
1
'hello'
[]
{}
Usage
if (user) {
// Runs if user is truthy
}
const result = value || 'default';
Key Takeaway
Falsy values are false, null, undefined, 0, '', NaN. Everything else is truthy. Important for conditionals.
#JavaScript#Truthy#Falsy#Beginner