Created
December 2, 2015 06:11
-
-
Save aaronpowell/164f6bed72eee8c62cdc to your computer and use it in GitHub Desktop.
This file contains 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
// assuming http://www.html5rocks.com/en/tutorials/es6/promises/ | |
var arr = [1, 2, 3, 4, 5]; | |
var promises = arr.map(x => $.getJSON('/foo/bar?baz=' + x)); | |
Promise.all(promises) | |
.then((result1, result2, result3, result4, result5) => { | |
//merge results | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment