1
2
3
4
5
6
7
8
9
10
To practice on your own, or to check code you believe shouldn't have been scored as incorrect, go to CodePen.
0,1,2,3,4,5,6,7,8,9
0
0
0
0
Fill in the blank to complete the first line for creating a new array from an existing array, nums. | const biggerNums = ___________(function(element) { | nums.map | nums\.map |
Fill in the blank to complete the first line for creating a new array from an existing array. Make up the name of the existing array. | const newArray = ___________(function(element) { | nums.map | [a-z_$][a-zA-Z0-9_$]*.map |
Fill in the blank to complete the first line for creating a new array from an existing array. Make up the name of both arrays. ___________________________(function(element) { | const biggerNums = nums.map | const[a-z_$][a-zA-Z0-9_$]*=[a-z_$][a-zA-Z0-9_$]*\.map | |
Fill in the blank to complete the first line for creating a new array from an existing array. Make up the name of the parameter. | const biggerNums = nums.map(____________) { | function(element | function\([a-z_$][a-zA-Z0-9_$]* |
Code the first line for creating a new array from an existing array. Make up all the names. | const biggerNums = nums.map(function(element) { | const[a-z_$][a-zA-Z0-9_$]*=[a-z_$][a-zA-Z0-9_$]*\.map\(function\([a-z_$][a-zA-Z0-9_$]*\){ | |
Code a complete map() statement that does nothing but copy the elements of an existing array to a new array. Use an anonymous function. Make up the names. | const newArr = arr.map(function(el) { return el; }); |
const[a-z_$][a-zA-Z0-9_$]*=[a-z_$][a-zA-Z0-9_$]*\.map\(function\(([a-z_$][a-zA-Z0-9_$]*)\){[\r\n]return\1;[\r\n]}\); | |
Code a complete statement that creates a new array by multiplying the values of an existing array by an integer. Use an anonymous function. Make up everything. | const newArr = arr.map(function(el) { return el * 7; }); |
const[a-z_$][a-zA-Z0-9_$]*r=[a-z_$][a-zA-Z0-9_$]*\.map\(function\(([a-z_$][a-zA-Z0-9_$]*)\){[\r\n]return\1\*(0|-?[1-9][\d]*);[\r\n]}\); | |
Code a complete statement that creates a new array by concatenating the string "True: " with each string value of an existing array. Use an anonymous function. Make up the names. | const newArr = arr.map(function(el) { return "True: " + el; }); |
const[a-z_$][a-zA-Z0-9_$]*=[a-z_$][a-zA-Z0-9_$]*\.map\(function\(([a-z_$][a-zA-Z0-9_$]*)\){[\r\n]return•True:•\+\1;[\r\n]}\); | |
|
|||
|