Promise.allSettled and other Async Methods Comparison

This updated Promise.allSettled comparison article explains exactly how Promise.allSettled() differs from Promise.all(), Promise.any(), and Promise.race(). If you’re looking for a complete breakdown of JavaScript’s Promise combinators, this introduction will help you understand how each method behaves, when to use it, and how it affects the reliability and performance of your asynchronous  code. You can also review the official MDN documentation here: Promise.allSettled on MDN.

What Promise.allSettled() Does

Promise.allSettled() waits for all promises to settle—whether they resolve or reject. Instead of failing fast, it delivers a complete report of all operations and their outcomes.
That makes it ideal for logging tasks, batch processing, and any workflow where you  must evaluate all results, including the failures.

Promise.allSettled([
  fetch('/api/a'),
  fetch('/api/b'),
  fetch('/api/c')
]).then(results => {
  console.log(results);
});

Example output:

[
  { status: "fulfilled", value: {...} },
  { status: "rejected", reason: "Network error" },
  { status: "fulfilled", value: {...} }
]

Because it never throws an error, Promise.allSettled() gives you full visibility into every asynchronous operation, making debugging and auditing significantly easier.

Promise.allSettled Comparison: How It Stacks Against Other Methods

1. Promise.all()

Promise.all() resolves only if every promise succeeds. Otherwise, it rejects immediately. This “fail-fast” behavior is great for workflows where every result must be valid—such as loading multiple configuration files or API calls that depend on each other.

Promise.all([p1, p2, p3])
  .then(values => console.log(values))
  .catch(err => console.error("Rejected early:", err));

2. Promise.any()

Promise.any() returns the first successfully resolved value. It only rejects when
all promises fail. This makes it perfect for redundancy-based operations, like
hitting multiple mirrored servers and using whichever responds first.

Promise.any([p1, p2, p3])
  .then(value => console.log("First success:", value))
  .catch(err => console.error("All promises failed"));

3. Promise.race()

With Promise.race(), the first promise to settle—whether resolved or rejected—is returned. This method is typically used for timeouts or situations where speed is more important than completeness.

Conclusion

As this Promise.allSettled comparison shows, no single Promise method is universally “best”—each solves a different problem. Promise.allSettled() is perfect when you need a complete picture of success and failure. Promise.all() is ideal for all-or-nothing workflows, Promise.any() shines when the first success is all you need, andPromise.race() is built for time-critical operations. Understanding these differences helps you write clearer, more predictable, and more resilient asynchronous code.

Follow Tevpro on X for all the latest technology news and articles.

Ready to Start Your Project?