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 | |
|---|---|---|
| 1for (let key in person) { ... } | Afor (let key in obj) { ... } | |
| 2console.log(person[key]); | BWrong - use obj[key], not obj.key, to access the value | |
| 3Loops over each property name (key) of an object | CAccesses the value for the current key using bracket notation | |
| 4Retrieves a value using the loop's key variable | DLoops over each key in the person object | |
| 5for (let key of obj) { ... } | EWrong - use 'in', not 'of', to loop over an object's keys | |
| 6console.log(obj.key); | Fobj[key] |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
for...in — Loops through each key (property name) of an object, one at a time.for (let key in person) {for (let key in person) {for (let color in car) {for (let prop in obj) {for (let prop in obj) {