On this page
  1. Promise.allSettled
  2. Signature & Overview
  3. Notes & Pitfalls
  4. Example

Promise.allSettled

Prev: all | Up: Promise | Next: race
Rel: Promise, Promise & Async Guide
Ref: MDN Web Docs — Promise.allSettled
Tags: #public #web #javascript #builtins #promise #tier/core


Signature & Overview

Promise.allSettled(iterable)

Waits for all promises to settle and resolves with { status: 'fulfilled'|'rejected', value|reason } objects.

Notes & Pitfalls

Example

const results = await Promise.allSettled([
  Promise.resolve("ok"),
  Promise.reject(new Error("boom")),
]);
console.assert(results[0].status === "fulfilled" && results[1].status === "rejected");

Linked from

Related notes