← JavaScript

Truthy and Falsy Values

A value that JavaScript treats as false in a boolean context, such as 0, "", null, undefined, or NaN.

Understanding Truthy and Falsy Values in JavaScript

What it does: An empty string is one of the falsy values. Unlike an empty string, an empty array is truthy. 0 is treated as false in a boolean context. NaN is one of JavaScript's falsy values. null is falsy, not truthy. Truthy values make an if condition run its true branch.

Common mistakes: An empty string is falsy, not truthy. The string "0" is actually truthy - it's not empty.

Class: _____________________  ·  Name: _____________________  ·  Date: _________

Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.

This module's key terms are also in a printable crossword (Modules 11–25) and word search (Modules 1–29).

Take this worksheet further — free with Cloodit

Each concept is reinforced from every angle — learned, then applied, then tested.

Learning
Duo
Is 0 a falsy value?
YesNo
Matches
"0" is treated as falsy in an if statement
↓
Wrong - the string "0" is actually truthy
Applying
Meanings
Term
Falsy
Meaning
A value that JavaScript treats as false in a boolean context, such as 0, "", null, undefined, or NaN.
Practice
let value = "";
Testing
Gaps
0 is a value
Check Answer
Spots
1"" is truthy
20 is falsy

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'Deer' badge — Forest Streak, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

1. Is 0 a falsy value?
A. Yes ✓
B. No
0 is treated as false in a boolean context.
2. Is an empty string "" falsy?
A. No
B. Yes ✓
An empty string is one of JavaScript's falsy values.
3. Is the string "0" truthy?
A. Yes ✓
B. No
Any non-empty string, even "0", is truthy.
4. Is an empty array [] falsy?
A. No ✓
B. Yes
An empty array is actually truthy, unlike an empty string.
5. Is NaN a falsy value?
A. No
B. Yes ✓
NaN is one of JavaScript's falsy values.

Match the Pairs

0 → A falsy value - treated as false in a boolean context
"hello" → A truthy value - treated as true in a boolean context
The empty string, always falsy → ""
An empty array, actually truthy → []
"0" is treated as falsy in an if statement → Wrong - the string "0" is actually truthy
[] is treated as falsy in an if statement → Wrong - an empty array is actually truthy

Key Term

Falsy
A value that JavaScript treats as false in a boolean context, such as 0, "", null, undefined, or NaN.

Fill in the Blanks

1. 0 is a falsy value
Hint: Type the word for a value treated as false in a boolean context.
2. "" is a falsy value
Hint: Type the word for a value treated as false in a boolean context.
3. 1 is a truthy value
Hint: Type the word for a value treated as true in a boolean context.
4. An empty string is a falsy value
Hint: Type the word for a value treated as false in a boolean context.
5. An array [] is a truthy value
Hint: Type the word for a value treated as true in a boolean context.

Spot the Error

Question 1
A "" is truthy
B 0 is falsy
C 1 is truthy
Line A — An empty string is falsy, not truthy.
Question 2
A null is falsy
B "0" is falsy
C NaN is falsy
Line B — The string "0" is actually truthy - it's not empty.
Question 3
A false is falsy
B undefined is falsy
C [] is falsy
D {} is truthy
Line C — An empty array is truthy, not falsy.
Question 4
A true is truthy
B 1 is truthy
C -1 is truthy
D 0 is truthy
Line D — 0 is falsy, not truthy.
Question 5
A false is falsy
B 0 is falsy
C "" is falsy
D null is falsy
E 1 is falsy
Line E — 1 is truthy, not falsy.

Student with a class code? Join your class →