Halloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PCHalloween DealsAmazon USOctober picks are moving - compare before checkoutAmazon US: current deals, useful picks and tech finds.See Picks×
FREEDOM251

Freedom251 › Blog › JavaScript

When to Use Promise.all, Promise.allSettled, or Promise.race

By Freedom251 Team · · 4 min read

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Choose based on what should make the combined promise settle: use Promise.all() when every task must fulfill, Promise.allSettled() when you need the final result of every task, and Promise.race() when the first settlement—success or failure—should decide the result. None of them cancels work that is still running.

Which promise method should you choose?

Your need Use What the returned promise does What you receive
Every operation must succeed for the combined result to be useful Promise.all() Fulfills if all inputs fulfill; rejects when an input rejects An array of fulfillment values, in input order
Tasks can succeed or fail independently, and you need to inspect all of them Promise.allSettled() Fulfills after every input settles An array of outcome records, in input order
The first success or failure should determine the result Promise.race() Adopts the state and result of the first input to settle The winning value or rejection reason

“First” in Promise.race() means first to settle, not first to succeed. For the different requirement “first fulfillment wins,” JavaScript provides Promise.any(); see MDN’s Promise.race() and Promise overview.

As an Amazon Associate I earn from qualifying purchases.

When to use Promise.all()

Use Promise.all(iterable) when the caller needs every operation to fulfill before it can use the combined result—for example, loading several required pieces of data for one screen. If an input rejects, the aggregate rejects with the rejection reason that determines its result; otherwise it fulfills with an array of values in the same order as the iterable, not the order tasks finish. MDN documents these behaviors in Promise.all().

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

MDN’s “Using promises” guide puts the early rejection behavior plainly: “If one of the promises in the array rejects, Promise.all() immediately rejects the returned promise.” MDN Web Docs, “Using promises” (accessed October 4, 2026).

A rejection means the aggregate has rejected; it does not mean the other operations have stopped. See the cancellation section below before using Promise.all() for work that may become unnecessary after a failure.

When to use Promise.allSettled()

Use Promise.allSettled(iterable) when each task has an independent outcome and you need to report or act on all of them, including failures. The aggregate fulfills only after every input has settled. Each result record has a status of "fulfilled" or "rejected"; fulfilled records contain a value, while rejected records contain a reason. Results follow input order. See MDN’s Promise.allSettled().

This is useful for independent jobs such as attempting several optional updates and then presenting a success or failure for each. It is not a faster version of Promise.all(): it waits for every input, and its aggregate does not reject merely because one task rejected.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

When to use Promise.race()

Use Promise.race(iterable) when whichever input settles first should settle the aggregate. If the winner fulfills, the race fulfills with its value; if it rejects, the race rejects with its reason. A fast failure therefore beats a slower success. See MDN’s Promise.race().

A common pattern is racing an operation against a timer to stop waiting after a deadline. That only makes the returned race settle; it does not stop the underlying operation. If the operation must be abandoned, it needs its own supported cancellation mechanism.

Do these methods run tasks in parallel?

No. These methods coordinate the outcomes of promises; calling one does not create parallel JavaScript execution. JavaScript runs one task at a time on a given thread, although control can shift among asynchronous operations. Parallel execution can be achieved with worker threads. MDN explains the distinction in its Promise overview.

Pass promises for operations you have started or otherwise obtained. Passing an async function itself does not call it: invoke the function to get its promise, then pass that promise to the combinator. For example, use Promise.all([loadUser(), loadSettings()]), rather than Promise.all([loadUser, loadSettings]). See MDN’s Promise.all().

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Early settlement does not cancel the other promises

Promise.all() can reject as soon as an input rejection determines the aggregate result, and Promise.race() can settle as soon as its first input settles. In either case, inputs that are still running continue unless the underlying operation is explicitly cancelled. The combinators settle the promise they return; they do not provide cancellation for their inputs. MDN discusses attached handlers and cancellation with AbortSignal in Using promises and its Promise overview.

When an API supports cancellation, pass it an AbortSignal and abort that signal when the work is no longer useful. Cancellation depends on the underlying operation honoring the signal; choosing a promise combinator alone cannot guarantee it.

What happens with an empty iterable?

  • Promise.all([]) fulfills with an empty array.
  • Promise.allSettled([]) fulfills with an empty array.
  • Promise.race([]) remains pending forever because no input can settle first.

For non-empty inputs, Promise.all() and Promise.allSettled() preserve iterable order in their arrays even when completion order differs. Details are in the MDN references for Promise.all(), Promise.allSettled(), and Promise.race().

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

JavaScriptPromisesWeb development

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.