← ACARA Digital Technologies Years 7–8

The boolean data type: true and false

A data type with only two values, true or false, written in lowercase with no quotes. Comparisons like 5 > 3 give a boolean, and true is not the same as the string "true".

Understanding The boolean data type: true and false in ACARA Digital Technologies Years 7–8

What it does: false is a boolean keyword. It is lowercase and has no quotation marks around it. Putting quotes around true makes it text, so typeof reports string instead of boolean. A boolean holds only true or false.

Common mistakes: Boolean values must be lowercase. True with a capital T is not defined and causes a ReferenceError. It should be let isReady = true;. Quotes turn true into a string, so typeof would print string instead of boolean. A boolean is written without quotes: let isHappy = true;.

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 562–580) and word search (Modules 522–580).

Take this worksheet further — free with Cloodit

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

Learning
Duo
Which line stores a boolean value?
let isRaining = "true";let isRaining = true;
Matches
let isOpen = True;
↓
Booleans must be lowercase. True with a capital T is not a boolean, so JavaScript gives a ReferenceError. Write true.
Applying
Meanings
Term
boolean
Meaning
A data type with only two values, true or false, written in lowercase with no quotes. Comparisons like 5 > 3 give a boolean, and true is not the same as the string "true".
Practice
let isRaining = true;
Testing
Gaps
let isRaining = ;
Check Answer
Spots
2let passed = score >= 5;
3let isReady = True;

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

The 'Reef Shark' badge — Reef Ruler, 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. Which line stores a boolean value?
A. let isRaining = true; ✓
B. let isRaining = "true";
Quotes turn true into a string. A boolean is written as true with no quotes.
2. Which is a valid boolean value in JavaScript?
A. false ✓
B. False
Boolean values must be lowercase: true and false. False with a capital F is not a boolean.
3. What is the data type of true?
A. string
B. boolean ✓
typeof true gives "boolean". Only "true" in quotes would be a string.
4. What does this log? console.log(typeof "false");
A. boolean
B. string ✓
The quotes make "false" a string, even though the word looks like a boolean.
5. What value does 5 > 3 give?
A. true ✓
B. "true"
A comparison gives a boolean, true, not a string.

Match the Pairs

let isRaining = true; → Stores a yes/no value in a variable as a boolean
let isAdult = age >= 18; → Stores the boolean result of a comparison
A boolean is written in lowercase with no quotes → let gameOver = false;
true and "true" are different: one is a boolean, the other is a string → console.log(typeof "true");
let isOpen = True; → Booleans must be lowercase. True with a capital T is not a boolean, so JavaScript gives a ReferenceError. Write true.
let isFinished = "false"; → The quotes turn false into a string, not a boolean. Remove the quotes and write false.

Key Term

boolean
A data type with only two values, true or false, written in lowercase with no quotes. Comparisons like 5 > 3 give a boolean, and true is not the same as the string "true".

Fill in the Blanks

1. let isRaining = true;
Hint: Type the boolean value that means yes, in lowercase with no quotes.
2. console.log(typeof false); // boolean
Hint: Type the name of the data type that only holds two values.
3. let age = 20; let canVote = age >= 18;
Hint: Type the comparison operator that checks if age is at least 18.
4. console.log(true === "true"); // false
Hint: Type the strict equality operator to compare a boolean with a string.
5. let score = 72; let isPassing = score > 50; console.log(isPassing);
Hint: Type the variable name that stores the result of the comparison.

Spot the Error

Question 1
A let score = 10;
B let passed = score >= 5;
C let isReady = True;
D console.log(isReady);
Line C — Boolean values must be lowercase. True with a capital T is not defined and causes a ReferenceError. It should be let isReady = true;
Question 2
A let isHappy = "true";
B console.log(isHappy);
C console.log(typeof isHappy);
Line A — Quotes turn true into a string, so typeof would print string instead of boolean. A boolean is written without quotes: let isHappy = true;
Question 3
A let age = 14;
B let canVote = "age >= 18";
C console.log(canVote);
Line B — Inside quotes the comparison is just text, so it is never worked out. Without the quotes, age >= 18 gives the boolean false.
Question 4
A let isOn = true;
B let count = 0;
C let isDone = fasle;
D console.log(isDone);
Line C — false is spelled wrong. JavaScript sees fasle as a variable name that does not exist and gives a ReferenceError. It should be false.
Question 5
A let temp = 30;
B let isHot = temp > 25;
C console.log("isHot");
D console.log(typeof isHot);
Line C — Quotes make console.log print the words isHot instead of the boolean stored in the variable. It should be console.log(isHot); which prints true.

Student with a class code? Join your class →