Created
June 26, 2020 14:04
-
-
Save zeptobook/3ba4c141e9afdb0a4f0140539b2489dc 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 p1 = new Promise((res, rej) => setTimeout(res, 1000)); | |
const p2 = new Promise((res, rej) => setTimeout(rej, 1000)); | |
Promise.allSettled([p1, p2]).then(data => console.log(data)); | |
// [ | |
// Object { status: "fulfilled", value: undefined}, | |
// Object { status: "rejected", reason: undefined} | |
// ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment