Assignment = versus equality ===
A single = stores a value in a variable (x becomes 5). Triple === compares two values and gives true or false (x is equal to 5). Writing if (x = 5) is a bug.
Understanding Assignment = versus equality === in ACARA Digital Technologies Years 7–8
What it does: The line reads 'lives becomes 3'. The single = is assignment, so it stores the value. The triple === compares lives with 0, so the if can decide whether the condition is true or false. === is a comparison. It asks a question and gives true or false. It does not change age. if (x = 5) is a bug because it stores 5 in x instead of comparing. Use === inside the brackets of an if. === compares and gives a boolean. 8 is not equal to 5, so the result is false. It never changes x. Only a single = changes what a variable holds. level === 2 just checks and leaves level alone.
Common mistakes: A single = stores a value, so this sets score to target instead of comparing them. To ask 'is equal to' you need ===: if (score === target) {. if (lives = 0) stores 0 in lives instead of checking it. The condition should compare with ===: if (lives === 0) {.
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 583–598) and word search (Modules 583–613).
Take this worksheet further — free with Cloodit
Each concept is reinforced from every angle — learned, then applied, then tested.
Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.
Over 100 of them, across seven natural biomes.
Turns their work into revision material ready for Flash Cards and Exam study.
Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.
Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.
Quick Questions
Match the Pairs
Key Term
= vs ===Fill in the Blanks
Spot the Error
Student with a class code? Join your class →