JavaScript Syntax — exercises and bug fixes
5 hands-on exercises and 5 find-the-bug challenges for the JavaScript Syntax lesson. Every one is checked automatically in the browser — write the code, run it, and the tests tell you what still fails.
Exercises(5)
- 1
Write a complete statement
easy10 minDeclare a value and show the word "complete".
- 2
Join strings correctly
easy10 minJoin "front" and "end" into one word.
- 3
Use single and double quotes
easy10 minShow a sentence that contains an apostrophe.
- 4
Nest a function call
easy10 minUppercase the word "ok" and show it.
- 5
Chain two operations
medium10 minTrim the spaces then uppercase " done ".
Find the bug(5)
- 1
Fix the unclosed string
easy8 minA quote is missing, so the code never runs.
- 2
Fix the mismatched quotes
easy8 minThe string opens with one quote style and closes with another.
- 3
Fix the missing parentheses
easy8 minThe method is referenced but never called.
- 4
Fix the wrong method spelling
easy8 minThe method name has the wrong capitalisation.
- 5
Fix the stray comma
easy8 minA comma where a semicolon belongs breaks the second statement.
Ready to write the code?
The editor, the automatic checks and the worked solutions open up with an account.
Open the workspace