Promise.all

Promise.all takes an array of promises and returns a promise that resolves with the array of their results, in order, when all of them are fulfilled. It is rejected as soon as a single one fails, with that error. It is used to run independent requests in parallel when you need them all together.

Example

const [users, orders] = await Promise.all([getUsers(), getOrders()])

Related concepts

The whole glossary