thecodezone.
The Code Zone
Short steps, at your pace · Free lessons and practice · Member video walkthroughs
Save your next small win.

Checking your account…

05.02 · Booleans / Watch · 2 min

Watch: Booleans introduction

A switch has two states. Give your program a true-or-false value it can actually use.

Activity 2 of 6 in Booleans

All courses

JavaScript Basics / 05.02

Watch: Booleans introduction

Not started

Watch Rob’s original Boolean introduction.

More options
Rob projects a switch in his coding studio, presents its two states, and holds a pause prop.
Rob’s comic strip · Booleans

OVERVIEW VIDEO · 1:44

Watch the overview.

Watch the overview, then explore the examples and practice below.

LEARN WITH THE CODE ZONE

Unlock this video walkthrough

Written lessons and coding practice are free. Video walkthroughs are included with a paid Code Zone membership or an active free trial.

Have a Code Zone website account? Use your learning account’s email to get a six-digit sign-in code, or use your existing website password.

Need a website account? Paid Skool members and active trial members can use the email from their membership questions to request a sign-in code. No invite link or Skool password needed.

Close this window to keep practicing. After signing in, you’ll return to this lesson.

Lesson videos are included with an active Code Zone membership. The written lesson and practice are free.

Read and update a Boolean state

Work through 4 focused steps. Read the explanation, type each requested change and check it before moving on. Your own code carries forward.

The mini-lesson opens in a new tab. Your own code carries forward; each step has a focused check and an optional hint.

Start mini-lesson(opens in a new tab)

4 steps · Saved work · Instant feedback

Ready to try it?

Practice in your browser and see your results.

Progress details

Have a question?

Ask the Code Zone community.

Ask a question in The Code Zone (opens in a new tab)

Continue learning

ONE STEP FORWARD

true and false are Boolean values. Quotation marks turn them into text.