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!"); | Alet score = 0; | |
| 2let name = prompt("Your name?"); | BThe typed version of an ask block: it asks the user a question and stores the answer in a variable. | |
| 3A set score to 0 block becomes a variable created with let and given a starting value. | Cask is a block name, not a JavaScript function. The typed version of an ask block is prompt(). | |
| 4A change score by 1 block becomes an assignment that updates the existing variable, with no new let. | Dsay is the name of a block, not a JavaScript function. The typed version of a say block is console.log(). | |
| 5say("Hello!"); | Escore = score + 1; | |
| 6let age = ask("How old are you?"); | FThe typed version of a say block: it shows a message in the console. |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
console.log, prompt, let — Blocks have typed JavaScript equivalents: a say block becomes console.log, an ask block becomes prompt, and a set variable block becomes let (or an assignment with =).console.log("Hello!");let name = prompt("What is your name?");let score = 0;let score = 0;
score = 5;let name = prompt("Name?");
console.log(name);