Created
June 22, 2017 22:36
-
-
Save lykkin/50b88d7062773f9ce7920b74002d249f to your computer and use it in GitHub Desktop.
eh
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
new Promise(function(res, rej) { | |
return Promise.all([ | |
1, | |
10, | |
100, | |
1000 | |
].map(function createPromises(time) { | |
return new Promise(function(res, rej) { | |
setTimeout(function() { | |
console.log('waited ' + time + ' ms!') | |
res() | |
}, time) | |
}) | |
})).then(res) | |
}).then(function() { | |
console.log('done!') | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment