Debugging with console.log
A temporary line that prints a variable's value while the program runs, so you can see where it goes wrong. Add a label to tell values apart, then remove it once fixed.
Understanding Debugging with console.log in ACARA Digital Technologies Years 9–10
What it does: The log is the first line inside the function, so it shows the incoming parameter values before any other code runs. A temporary log prints a variable's value so you can see where it goes wrong. A label tells you which variable the printed value belongs to, especially when many values are logged. Debugging logs are temporary. Remove them once the bug is fixed to keep the console clean. The label and the value are separate arguments, so a comma must go between them. Adding labels like console.log('score:', score) makes each value identifiable in the console. Every console.log call needs a matching closing bracket, like console.log('total:', total);.
Common mistakes: There is a comma missing between the label and the value. It should be console.log('b:', b); so the label and value are separate arguments. The closing bracket of console.log is missing. It should be console.log('w', w); so the debug line runs without a syntax error.
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 710–727) and word search (Modules 710–742).
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
console.log(label, value)Fill in the Blanks
Spot the Error
Student with a class code? Join your class →