Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.
Shade in the A or B circle for each question.
Draw a line connecting each item on the left to its match on the right.
| Left column | Right column | |
|---|---|---|
| 1console.log("Hello); | Aif (age >= 13) { console.log("Teen"); } | |
| 2SyntaxError: Unexpected token '}' | BA string that is never closed, because the closing quote is missing. This causes a SyntaxError. | |
| 3Every opening curly brace { needs a matching closing brace } to avoid a SyntaxError | CThe closing brace } is missing at the end of the loop, so JavaScript gives a SyntaxError. Add } on a new line after console.log(i); | |
| 4Every opening quote needs a matching closing quote so the string is complete | DThe closing bracket ) is missing after the condition, so JavaScript gives a SyntaxError. It should be if (score > 50) { | |
| 5if (score > 50 { console.log("Pass"); } | EJavaScript found a symbol it did not expect, often because brackets or braces do not pair up. | |
| 6for (let i = 0; i < 3; i++) { console.log(i); | Flet name = "Ava"; |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
SyntaxError — An error shown when code breaks JavaScript's rules, like a missing quote, bracket or brace. JavaScript can't read the code, so the program won't run until you fix it.// Both quotes are here, so this runs
let pet = "Rex";function greet() {
console.log("Hi");
}// A missing quote causes a SyntaxError
console.log("Hi");// Unexpected token = stray symbol
console.log("Hi");if (score > 50) {
console.log("Pass");
}