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 | |
|---|---|---|
| 1nums.map(function(n) { return n * 2; }) | AWrong - 'map' must start with a lowercase m | |
| 2users.map(function(u) { return u.name; }) | BCreates a new array of just the users' names | |
| 3Runs a function on every element to build a new array | CCreates a new array with each number doubled | |
| 4Sends the transformed value back into the new array | Darray.map(function(item) { ... }) | |
| 5nums.Map(function(n) { return n * 2; }) | EWrong - missing the 'return' keyword | |
| 6nums.map(function(n) { n * 2; }) | Freturn |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
map() — Creates a new array by running a given function on every element of the original array.let doubled = nums.map(function(n) {let doubled = nums.map(function(n) {return n * 2;let names = users.map(function(u) {let squares = nums.map(function(n) {
return n * n;
});