Skip to content

Instantly share code, notes, and snippets.

@zzlalani
Created June 22, 2020 15:33
Show Gist options
  • Save zzlalani/537640f35a9c4c942fcef7b4358de905 to your computer and use it in GitHub Desktop.
Save zzlalani/537640f35a9c4c942fcef7b4358de905 to your computer and use it in GitHub Desktop.
const P = [
Promise.resolve(1),
Promise.reject(0),
Promise.resolve(2),
];
Promise.all(P).then(res => {
console.log(res);
}).catch(rej => {
console.log(rej);
});
Promise.allSettled(P).then(res => {
console.log(res);
}).catch(rej => {
console.log(rej);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment