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 | |
|---|---|---|
| 1let score = 3.5; | Alet total = 7 + 3; | |
| 2let temp = -2; | BStores a negative number. The minus sign is part of the number, and it still has no quotes. | |
| 3A whole number with no quotes is a number, so you can calculate with it | CThe quotes make "13" a string, so age + 2 joins the text and prints 132 instead of adding to give 15. Remove the quotes: let age = 13; | |
| 4A value in quotes is a string, not a number, even if it looks like a number | DA decimal number uses a full stop, not a comma. Write let price = 3.50; so it is one number. | |
| 5let age = "13"; console.log(age + 2); | EStores a decimal number. It has no quotes, so JavaScript treats it as a number you can calculate with. | |
| 6let price = 3,50; | Flet answer = "5"; |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
number — A value written without quotes, whole (7), decimal (3.5) or negative (-2), that you can calculate with. 5 is a number but '5' in quotes is a string, which is text.let lives = 3;
console.log(lives + 2);// negative number: minus two
let change = -2;// decimal number: three and a half
let price = 3.5;let a = 5;
let b = "5";
console.log(typeof a); // numberlet n = 7;
console.log(typeof n); // number