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 | |
|---|---|---|
| 1score = 10; | Ascore + 1 works out an answer but never stores it, so score is still 4. There is no = to reassign it. | |
| 2score = score + 1; | Blet lives = 3; lives = 2; | |
| 3To change a let variable that already exists, use its name and = only, with no let in front. | CWorks out the old score plus 1 first, then stores that new value back in score. | |
| 4A new value can be built from the old value, because the right side is worked out before it is stored. | Dlet score = 5; score = score + 2; | |
| 5let score = 0; let score = 10; | EReplaces the old value of the existing let variable score with 10, without writing let again. | |
| 6let score = 4; score + 1; | Flet is written twice for the same name, which causes a SyntaxError because score is already declared. |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
score = score + 1; — Reassigns an existing let variable. The right side is worked out first using the old value, then the new value replaces it. Don't write let again.let score = 10;
score = 20;
console.log(score);let score = 10;
score = score + 1;
console.log(score);let lives = 3;
lives = 2;
console.log(lives);let coins = 5;
coins = coins * 2;
console.log(coins);let points = 4;
points = points + 3;
console.log(points);