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 | |
|---|---|---|
| 1new Map() | Aages.set("Tom", 30) | |
| 2scores.set("Sam", 90) | Bscores.get("Sam") | |
| 3Reads the value stored under a given key | CWrong - 'Map' must start with a capital M | |
| 4Adds a new key-value pair to a Map | DStores 90 under the key "Sam" in the scores Map | |
| 5let m = new map(); | EWrong - 'set' must start with a lowercase s | |
| 6m.Set("a", 1); | FCreates a new, empty Map |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
new Map() — Creates a new Map, a built-in object that stores key-value pairs.let scores = new Map();scores.set("Sam", 90);console.log(scores.get("Sam"));let ages = new Map();ages.set("Tom", 30);