Favorites

JavaScript Promise.all() Method

☕
Enjoying this site?

Help keep it running with a small coffee donation. Every bit of support is appreciated!

Buy us a coffee
Promise.all()
JavaScript Promise Static methodThis method is supported by all modern browsers.
Updated 28th November 2026

The Promise.all() static method waits for several promises to finish and gives back all their results in an array. If any one rejects, the whole thing rejects.

Description

The Promise.all() static method takes several promises and returns a single promise that fulfills when all of them have fulfilled, with an array of their results in the same order as the input. It's the standard way to run independent asynchronous tasks in parallel, such as several fetch() requests.

If any promise rejects, the returned promise rejects straight away with that reason, and the other results are lost (though the other tasks keep running). When you want every result regardless of failures, use Promise.allSettled().

An empty array resolves immediately with an empty array, and values that aren't promises are passed through as they are. A common pattern combines it with map(): await Promise.all(ids.map(id => load(id))). If you have hundreds of tasks, starting them all at once can overwhelm a server, so process them in smaller batches instead.

Syntax

Promise.all(iterable)

Parameters

  • iterableAn iterable, such as an array, of promises or values.

Return Value

A promise that fulfills with an array of all the results, in order, or rejects with the first rejection reason.

Example

const delay = (ms, v) => new Promise(r => setTimeout(() => r(v), ms));

Promise.all([delay(300, 'a'), delay(100, 'b'), 42]).then(values => {
  console.log(values);
});

Promise.all([delay(100, 'ok'), Promise.reject(new Error('fail'))])
  .catch(err => console.log('Rejected:', err.message));

Browser Support

The following information will show you the current browser support for the Promise.all() method. Hover over a browser icon to see the version that first introduced support for this method.

This method is supported by all modern browsers.

Desktop

Chrome
Edge
Firefox
Opera
Safari

Tablets & Mobile

Chrome Android
Firefox Android
Opera Android
Safari iOS
Samsung Internet
Android WebView
-
Supported Unknown Not supported
☕
Enjoying this site?

Help keep it running with a small coffee donation. Every bit of support is appreciated!

Buy us a coffee