Skip to content

Instantly share code, notes, and snippets.

@khaosdoctor
Last active April 7, 2019 18:41
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 khaosdoctor/3b0f9aec523ee0a7cd1351b3441f6efc to your computer and use it in GitHub Desktop.
Save khaosdoctor/3b0f9aec523ee0a7cd1351b3441f6efc to your computer and use it in GitHub Desktop.
Promise.all([
new Promise(resolve => setTimeout(() => resolve([]), 5500)),
new Promise((resolve, reject) => setTimeout(() => reject([1]), 3000)),
new Promise(resolve => setTimeout(() => resolve([1,2]), 2200))
])
.then(results => results.length)
.then(c => console.info(c))
.catch(err => console.error(err))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment