Promise.all, allSettled, race, and any: A Complete Guide
Four promise combinators with different behaviors. Here is each one with examples.
Promise.all, allSettled, race, and any: A Complete Guide
JavaScript has four promise combinators. Each has a different behavior. Here is each one.
Promise.all (All Must Succeed)
const [a, b, c] = await Promise.all([fetchA(), fetchB(), fetchC()]);
- Runs all in parallel.
- Waits for all to fulfill.
- If any rejects, the whole thing rejects (fast fail).
- Results are in order.
Promise.allSettled (Wait for All, Even Failures)
const results = await Promise.allSettled([fetchA(), fetchB(), fetchC()]); results.forEach((r) => { if (r.status === "fulfilled") console.log(r.value); else console.error(r.reason); });
- Runs all in parallel.
- Waits for all to settle (fulfilled or rejected).
- Never rejects. Returns
[{ status, value/reason }].
Promise.race (First to Settle Wins)
const result = await Promise.race([fetchA(), fetchB()]);
- Runs all in parallel.
- Returns as soon as the first promise settles (fulfilled or rejected).
- If the first to settle fulfills, the race fulfills.
- If the first to settle rejects, the race rejects.
Promise.any (First Success Wins)
const result = await Promise.any([fetchA(), fetchB(), fetchC()]); `` - Runs all in parallel. - Returns as soon as the first promise **fulfills**. - If all reject, rejects with `AggregateError`. ### Comparison | Combinator | Waits For | Rejects If | Returns | |---|---|---|---| | `Promise.all` | All fulfill | Any rejects | Array of values | | `Promise.allSettled` | All settle | Never | Array of { status, value/reason } | | `Promise.race` | First settles | First rejects | First value or error | | `Promise.any` | First fulfills | All reject | First value (or AggregateError) | ### The Takeaway `Promise.all` (all must succeed), `allSettled` (all settle, partial success), `race` (first to settle, timeouts), `any` (first success, all-fail returns `AggregateError`). Use the right combinator for your use case.
Promise.all (all must succeed, fast fail), Promise.allSettled (all settle, never rejects), Promise.race (first to settle wins), Promise.any (first to fulfill wins, AggregateError if all reject).
Promise.all rejects if any promise rejects (fast fail). Promise.allSettled waits for all promises, even if some reject, and returns an array of { status, value/reason } objects. Use allSettled for partial success.
Promise.race returns the first promise to settle (fulfilled or rejected). Promise.any returns the first promise to fulfill (ignores rejections until all reject). race can reject on the first rejection; any only rejects if all reject.
An error type thrown by Promise.any when all promises reject. It has an errors property containing an array of all the individual rejection reasons. This lets you see why each promise failed.
Yes. The results array is in the same order as the input promises, regardless of which promise resolves first. This is one advantage over manual callback-based parallel execution.
Ready to master React completely?
Want to upskill yourself, crack your next interview, and get your dream job? Join our comprehensive course to dive deeper with high-quality video tutorials, solve interview questions, and a premium community.
Master React
Want to upskill yourself, crack your next interview, and get your dream job? Join our comprehensive course.

