Skip to content

Instantly share code, notes, and snippets.

@khaosdoctor
Created April 7, 2019 19:01
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/b6bcd01ce13d9b237ffe66c9a5c053bc to your computer and use it in GitHub Desktop.
Save khaosdoctor/b6bcd01ce13d9b237ffe66c9a5c053bc to your computer and use it in GitHub Desktop.
const promises = [ fetch('index.html'), fetch('https://does-not-exist/') ];
const results = await Promise.allSettled(promises);
const successfulPromises = results.filter(p => p.status === 'fulfilled');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment