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 | |
|---|---|---|
| 1ReferenceError: score is not defined | Anme is misspelled, so the console shows a ReferenceError: nme is not defined. Change it to name. | |
| 2TypeError: player.jump is not a function | BThe closing bracket is missing, so the console shows a SyntaxError. Add ) before the semicolon. | |
| 3A SyntaxError means the code is written wrongly, such as a missing bracket, so JavaScript cannot run it | CThe code tried to call something as a function, but it is not a function (it may be missing or misspelled) | |
| 4The line number in the console tells you where to start looking for the problem | DThe code uses a variable name that was never declared, so JavaScript cannot find it | |
| 5console.log(score; | ESyntaxError: missing ) after argument list | |
| 6let name = 'Ava'; console.log(nme); | Fscript.js:7 Uncaught ReferenceError: total is not defined |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
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.try { console.log(missing); }
catch (e) { console.log(e.name); }try { null.length; }
catch (e) { console.log(e.message); }try { let n = 5; n(); } catch (e) {
console.log(e.name === "TypeError");
}try { throw new SyntaxError("Bad"); }
catch (e) { console.log(e.name); }try { undefinedFn(); }
catch (e) { console.log(e.stack); }