Truthy and Falsy Values, online

Six activities your students do on their own devices. See who's finished, and their scores.

Truthy and Falsy Values in one minute

What students need to know

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.

Mistakes students make

  • An empty string is falsy, not truthy.
  • The string "0" is actually truthy - it's not empty.
  • An empty array is truthy, not falsy.
  • 0 is falsy, not truthy.
PREVIOUS · MODULE 12Boolean Logic
YOU ARE HERE · MODULE 13Truthy and Falsy Values
NEXT · MODULE 14If Statements

Discover other journeys with this module

What students will learn in this module

Every question in Module 13

Quick questions

  1. Is 0 a falsy value?AYesBNo
  2. Is an empty string "" falsy?ANoBYes
  3. Is the string "0" truthy?AYesBNo
  4. Is an empty array [] falsy?ANoBYes
  5. Is NaN a falsy value?ANoBYes

Key terms

Students type the meaning of:

  • Falsy

Match the pairs

0Match it to what it does
"hello"Match it to what it does
The empty string, always falsyMatch it to what it does
An empty array, actually truthyMatch it to what it does
"0" is treated as falsy in an if statementMatch it to what it does
[] is treated as falsy in an if statementMatch it to what it does

Fill in the blanks

  1. 0 is a _____ value

    Hint: Type the word for a value treated as false in a boolean context.

  2. "" is a _____ value

    Hint: Type the word for a value treated as false in a boolean context.

  3. 1 is a ______ value

    Hint: Type the word for a value treated as true in a boolean context.

  4. An empty string is a _____ value

    Hint: Type the word for a value treated as false in a boolean context.

  5. An array [] is a ______ value

    Hint: Type the word for a value treated as true in a boolean context.

Spot the error

Question 1

A"" is truthyB0 is falsyC1 is truthy

Question 2

Anull is falsyB"0" is falsyCNaN is falsy

Question 3

Afalse is falsyBundefined is falsyC[] is falsyD{} is truthy

Question 4

Atrue is truthyB1 is truthyC-1 is truthyD0 is truthy

Question 5

Afalse is falsyB0 is falsyC"" is falsyDnull is falsyE1 is falsy