Reassigning a let variable
Reassigns an existing let variable. The right side is worked out first using the old value, then the new value replaces it. Don't write let again.
Understanding Reassigning a let variable in ACARA Digital Technologies Years 7–8
What it does: The first line declares lives with let. The second line reassigns it without let, so lives is now 2. score + 2 is worked out as 5 + 2 = 7, and then 7 replaces the old value of score. The variable already exists, so you just write score = 10; with no let. Writing let again would cause a SyntaxError. The computer works out score + 1 as 4 + 1 = 5 first, then stores 5 back in score. let is only used the first time, when you create the variable. After that, just use name = newValue;.
Common mistakes: The declaration is missing the = sign. It should be let score = 0; so the variable starts with a value. let is used again for a variable that already exists, which is an error. To reassign it, write lives = lives - 1; with no let.
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.
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
score = score + 1;Fill in the Blanks
Spot the Error
Student with a class code? Join your class →