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 | |
|---|---|---|
| 1{name: "Sam", age: 12} | ACreates an object with two key-value pairs | |
| 2person.name | BWrong - objects use curly braces, not round brackets | |
| 3Accesses a value using a key wrapped in quotes | CWrong - the key in bracket notation needs quotes | |
| 4Separates a key from its value inside an object | DAccesses the name value using dot notation | |
| 5let a = (name: "Sam"); | E: | |
| 6console.log(person[name]); | Fperson["age"] |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
{} — Creates an object holding key-value pairs, which can then be accessed by key.let person = {name: "Sam"};console.log(person.name);console.log(person["name"]);let car = {color: "red"};let dog = {name: "Rex"};