Created
April 18, 2015 18:16
-
-
Save terakilobyte/512fb77f90087565c6c5 to your computer and use it in GitHub Desktop.
FEM async
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Array.prototype.concatAll = function() { | |
var results = []; | |
this.forEach(subArray => { | |
subArray.forEach(item => { | |
results.push(item); | |
}); | |
// ------------ INSERT CODE HERE! ---------------------------- | |
// Add all the items in each subArray to the results array. | |
// ------------ INSERT CODE HERE! ---------------------------- | |
}); | |
return results; | |
}; | |
/* | |
return movieLists.map(function(genre) { | |
return genre.videos.map(function(video) { | |
return video.id; | |
}); | |
}).concatAll(); | |
*/ | |
// I stupidly left out a paren | |
return movieLists.map(genre => genre.videos.map(video => video.id)).concatAll(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment