Created
August 15, 2016 17:23
-
-
Save timwco/ab25f9f18bd708bfdd71d586a5d799f2 to your computer and use it in GitHub Desktop.
Resolve A List of Promises
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
'use strict'; | |
let promise1 = $.getJSON('http://www.omdbapi.com/?i=tt1285016'); | |
let promise2 = $.getJSON('http://www.omdbapi.com/?i=tt0111161'); | |
let promise3 = $.getJSON('http://www.omdbapi.com/?i=tt0109830'); | |
let promise4 = $.getJSON('http://www.omdbapi.com/?i=tt0068646'); | |
let promise5 = $.getJSON('http://www.omdbapi.com/?i=tt0114369'); | |
let promises = [promise1, promise2, promise3, promise4, promise5]; | |
Promise.all(promises).then( res => { | |
console.log(res); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment