Created
September 21, 2019 06:58
-
-
Save ppeeou/64411567ab3355be333e63741a140f87 to your computer and use it in GitHub Desktop.
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
const promise1 = Promise.resolve(3); | |
const promise2 = new Promise((resolve, reject) => setTimeout(reject, 100, 'foo')); | |
const promises = [promise1, promise2]; | |
Promise.allSettled(promises) | |
.then((results) => results.forEach((result) => console.log(result.status))); | |
// expected output: | |
// "fulfilled" | |
// "rejected" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment