Reading a JavaScript error message
The console text that names the error type, such as SyntaxError or TypeError, and the line number where it happened, so you know what went wrong and where to look.
Understanding Reading a JavaScript error message in ACARA Digital Technologies Years 9–10
What it does: This message shows broken grammar in the code, such as a missing closing bracket, and it appears before the program runs. The script.js:7 part gives the file and line number, so the student knows to check line 7 first. The first words of the message name the error type. A ReferenceError means you used a name that JavaScript has not seen declared. A ReferenceError names the missing variable, which tells the student to check the spelling or the declaration. A TypeError of the 'x is not a function' kind means the name before the brackets is not a method or function, so check its name and where it is defined.
Common mistakes: The console would report a SyntaxError (Unexpected token ';') on line 1. The variable has no value after the = sign. It should be const score = 10;. The console would report ReferenceError: nmae is not defined, pointing at line 2. The variable name is misspelled. It should be console.log(name);.
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
error messageFill in the Blanks
Spot the Error
Student with a class code? Join your class →