javascript · level 1 · unit 1 · lesson 4
- meet it
- guess first
- your turn
- fix it
- nailed it
Tap a green word if you get lost.
meet it
An is a clue, not a disaster.
An error is JavaScript saying it got stuck. Everyone gets them, even experts. The message starts with the name of the problem, then a few words about it. Read it slowly.
A means JavaScript cannot read your code, like a sentence with words missing. Often a quote mark or a bracket has gone astray. Nothing runs until you fix it.
A means JavaScript met a name it does not know. JavaScript is , so Console with a capital C is a stranger to it. The lines above the mistake still run.
Fixing errors is a big part of writing code, so every one you solve makes you better at it.
guess first
One capital letter. What happens?
Guess before you run it. Wrong guesses are how you learn, and nothing is marked.
Console.log("Hello!");
your turn
Your turn. Close everything you open.
Type your superpower in place of the blank. Then finish the line so the quote and the bracket are both closed, add the semicolon, and press run.
fix it
The picnic plan is broken. Can you fix it?
- Read the error's name first. Which kind of error is it?
- It is a SyntaxError, so hunt for a missing quote or bracket. Count the quote marks on line 2.
- A string needs a quote at both ends. Add " straight after the ! on line 2, then press run.
nailed it
you turned errors into clues. :D
- Errors are clues. Read the error's name first.
- A SyntaxError often means a missing quote or bracket.
- JavaScript is case-sensitive:
consoleworks,Consoledoes not.
new words in your collection
- error
- SyntaxError
- ReferenceError
- case-sensitive
This lesson isn’t saved. A free account remembers every lesson you finish.