33. implement `Promise.allSettled()`

JavaScript
Is this helpful ?

from all members: - accepted / - tried

The Promise.allSettled() method returns a promise that resolves after all of the given promises have either fulfilled or rejected, with an array of objects that each describes the outcome of each promise.

Different from Promise.all() which rejects right away once an error occurs, Promise.allSettled() waits for all promises to settle.

Now can you implement your own allSettled() ?

note

Do not use Promise.allSettled() directly, it helps nothing.

Let's try to solve this problem within 10 mintues.

Discuss(29)