Skip to content

Instantly share code, notes, and snippets.

@alnorris
Created June 4, 2019 12:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alnorris/9f4c2689be44e158c862b2ed31107616 to your computer and use it in GitHub Desktop.
Save alnorris/9f4c2689be44e158c862b2ed31107616 to your computer and use it in GitHub Desktop.
function promiseAll(arr) {
// fill this in
}
promiseAll([Promise.resolve(1), Promise.resolve(4)]).then(resp => {
console.log(resp)
})
.catch(e => console.log(e))
promiseAll([Promise.resolve('success'), Promise.reject('Error!')]).then(resp => {
console.log(resp)
})
.catch(e => console.log(e))
// Print below:
// [ 1, 4 ]
// Error!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment