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 loop through the array. spaceAliens______(displayFunnyName); | .forEach | \.forEach | |
Fill in the blank to loop through the array, calling the function displayIt on each iteration. | spaceAliens____________; | .forEach(displayIt) | \.forEach\(displayIt\) |
Loop through the array pets, calling the function feedThem on each iteration. | pets.forEach(feedThem); | pets\.forEach\(feedThem\); | |
Loop through the array x, calling the function y on each iteration. | x.forEach(y); | x\.forEach\(y\); | |
Fill in the blank to complete the anonymous function. | spaceAliens.forEach(________{ console.log(anAlien); }); |
function(anAlien) | function\(anAlien\) |
Loop through an array. Use an anonymous function to display each element in the console. Make up everything. | recipes.forEach(function(aRecipe) { console.log(aRecipe); }); |
[a-z_$][a-zA-Z0-9_$]*\.forEach\(function\(([a-z_$][a-zA-Z0-9_$]*)\){[\r\n]console\.log\(\1\);[\r\n]}\); | |
Fill in the blank to loop through the array to display each element in the console. Use a shorthand arrow function. The variable is anAlien. | spaceAliens.forEach(__________________________; | anAlien => console.log(anAlien)) | anAlien=>console\.log\(anAlien\)\) |
Loop through an array. Use a shorthand arrow function to display each element in the console. Make up everything. | recipes.forEach(aRecipe => console.log(aRecipe)); | [a-z_$][a-zA-Z0-9_$]*\.forEach\([a-z_$][a-zA-Z0-9_$]*=>console\.log\(\1\)\); | |
|
|||
|