Interview Q&A / Node.js

BeginnerQuick answer1 min readUpdated 3 Oct 2026

What is the difference between Promise.all and Promise.allSettled?

SHORT ANSWER

Promise.all rejects as soon as any promise rejects and gives you results only if all succeed. Promise.allSettled always waits for every promise and reports each outcome as fulfilled or rejected.

Explain it simply

Suppose you send SMS reminders to five friends about a cricket match. With Promise.all, you say, "If even one message fails, I will treat the whole job as failed and stop caring about the rest." With Promise.allSettled, you say, "Try all five, then give me a report of who got it and who did not."

Example

js
const ok = (v) => Promise.resolve(v);
const fail = (m) => Promise.reject(new Error(m));

async function demo() {
  try {
    await Promise.all([ok(1), fail("net down"), ok(3)]);
  } catch (e) {
    console.log("all failed fast:", e.message); // all failed fast: net down
  }

  const results = await Promise.allSettled([ok(1), fail("net down"), ok(3)]);
  console.log(results.map((r) => r.status));
  // [ 'fulfilled', 'rejected', 'fulfilled' ]
}
demo();

Each allSettled entry is { status: "fulfilled", value } or { status: "rejected", reason }.

Note: the other promises in Promise.all do not get cancelled when one rejects. They keep running; their results are just ignored.

Related helpers: Promise.race settles with the first promise to finish, and Promise.any resolves with the first success.

What to say in the interview

"Promise.all is all-or-nothing and fails fast. Promise.allSettled never rejects and gives per-item status. I use all when every result is required, and allSettled for independent jobs like sending notifications."

Common mistakes

  • Using Promise.all for optional tasks and losing the successful results.
  • Assuming a rejection in Promise.all cancels the other work.

#nodejs#promises#async

Related questions

Practise more Node.js questions

Test your recall with short answers, then return to the detailed explanations when you need context.

Open Node.js quick answers →

Get new questions like this by email

One short email when something new and useful lands. No spam, unsubscribe in one tap.

By subscribing you agree to the Privacy Policy.