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 isRaining = true; | Alet gameOver = false; | |
| 2let isAdult = age >= 18; | BStores the boolean result of a comparison | |
| 3A boolean is written in lowercase with no quotes | Cconsole.log(typeof "true"); | |
| 4true and "true" are different: one is a boolean, the other is a string | DBooleans must be lowercase. True with a capital T is not a boolean, so JavaScript gives a ReferenceError. Write true. | |
| 5let isOpen = True; | EThe quotes turn false into a string, not a boolean. Remove the quotes and write false. | |
| 6let isFinished = "false"; | FStores a yes/no value in a variable as a boolean |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
boolean — A data type with only two values, true or false, written in lowercase with no quotes. Comparisons like 5 > 3 give a boolean, and true is not the same as the string "true".let isRaining = true;console.log(typeof false); // booleanlet age = 20;
let canVote = age >= 18;console.log(true === "true"); // falselet score = 72;
let isPassing = score > 50;
console.log(isPassing);