Promise.allSettled

Promise.allSettled waits for all the promises to finish, whether they succeed or not, and returns an array of objects describing each one: status (fulfilled or rejected) and value or reason. It never rejects, which lets you use the successes despite partial failures.

Example

const res = await Promise.allSettled([a(), b()])
res.filter(r => r.status === 'fulfilled')

Related concepts

The whole glossary