Promise.allSettled() never rejects — it waits for every promise to finish and reports each individual outcome. It is the correct tool whenever partial failure is an expected, normal part of the operation.
1Promise.allSettled() Deep Dive | JavaScript Tutorial - In-Depth Guide Part 1
Promise.allSettled() waits for every promise to finish, no matter whether it fulfilled or rejected, and never rejects itself.
const results = await Promise.allSettled([
Promise.resolve('ok'),
Promise.reject('failed'),
]);
// never throws, regardless of the rejection aboveNever Rejects
2Promise.allSettled() Deep Dive | JavaScript Tutorial - In-Depth Guide Part 2
Each entry in the result array is an object shaped like { status: 'fulfilled', value } or { status: 'rejected', reason }.
[
{ status: 'fulfilled', value: 'ok' },
{ status: 'rejected', reason: 'failed' },
]The Result Object Shape
3Promise.allSettled() Deep Dive | JavaScript Tutorial - In-Depth Guide Part 3
Filtering settled results by status is the standard way to separate successes from failures after the fact.
const succeeded = results.filter(r => r.status === 'fulfilled').map(r => r.value);
const failed = results.filter(r => r.status === 'rejected').map(r => r.reason);Separating Successes and Failures
4Promise.allSettled() Deep Dive | JavaScript Tutorial - In-Depth Guide Part 4
Promise.allSettled() is the right tool for bulk operations where individual item failures are expected and should be reported, not treated as fatal.
const results = await Promise.allSettled(userIds.map(sendNotification));
const failedCount = results.filter(r => r.status === 'rejected').length;
reportBatchResult({ total: userIds.length, failed: failedCount });Bulk Operations
5Promise.allSettled() Deep Dive | JavaScript Tutorial - In-Depth Guide Part 5
Because it never rejects, forgetting a try/catch around Promise.allSettled() is safe — but you must still explicitly check the per-item status or you'll silently ignore failures.
// Safe from crashing, but still needs explicit failure handling:
const results = await Promise.allSettled(tasks);
if (results.some(r => r.status === 'rejected')) {
notifyPartialFailure(results);
}Don't Forget to Check Status
6Step-by-Step Breakdown
Promise.allSettled() waits for every promise to finish, no matter whether it fulfilled or rejected, and never rejects itself.
Checkpoint: Does Promise.allSettled() ever throw/reject itself, even if every input promise rejects?
- →Yes, if all inputs reject, it rejects too
- →No, it always resolves with an array describing each outcome
Each entry in the result array is an object shaped like { status: 'fulfilled', value } or { status: 'rejected', reason }.
Checkpoint: What property holds the result on a fulfilled entry from Promise.allSettled()?
- →.value
- →.reason
Filtering settled results by status is the standard way to separate successes from failures after the fact.
Promise.allSettled() is the right tool for bulk operations where individual item failures are expected and should be reported, not treated as fatal.
Because it never rejects, forgetting a try/catch around Promise.allSettled() is safe — but you must still explicitly check the per-item status or you'll silently ignore failures.
Next, we'll explore 'Promise.race() Deep Dive'.
Level Up 🚀
Advanced cheat sheets, SEO tricks, and interview prep for this topic.
Browser Support
Fully supported.
Fully supported.
Fully supported.
Fully supported.
Accessibility (A11y)
1Summarize Bulk Operation Results Accessibly After allSettled() Completes
After a bulk action (like 'send to all') completes via Promise.allSettled(), announce a single clear summary ('42 sent, 3 failed') via an ARIA live region, rather than leaving screen reader users to infer the outcome from a silent UI change.
SEO Implications
- 1
No Direct SEO Effect
Promise.allSettled() is a concurrency-control tool; its SEO relevance is limited to ensuring reliable batch data processing behind rendered content.
Best Practices
Use Promise.allSettled() for Any Batch Where Partial Success Is Acceptable
Sending many independent requests (notifications, uploads, validations) should not lose every result just because one item failed — allSettled() gives you the complete picture.
Always Explicitly Handle the Rejected Entries
Since allSettled() never throws, silently ignoring rejected entries in the results means failures can go unnoticed; always filter for and act on rejected outcomes.
Frequent Bugs
Processing an allSettled() result array as if every entry has a `.value`, causing failed entries (which only have `.reason`) to produce `undefined` silently mixed into successful results.
Always branch on `status` first, reading `.value` only for fulfilled entries and `.reason` only for rejected ones.
Using allSettled() but never checking for rejected entries, so failures are captured but never surfaced to the user or logged anywhere.
Explicitly filter for `status === "rejected"` entries after the call and report or log them.
Real-World Examples
Sending Notifications to Many Users, Reporting Partial Failures
A feature needed to email a batch of users about an update, where a handful of invalid or bounced addresses shouldn't prevent the rest from being notified.
const results = await Promise.allSettled(users.map(sendEmail));
const failedEmails = results
.map((r, i) => ({ r, user: users[i] }))
.filter(({ r }) => r.status === 'rejected')
.map(({ user }) => user.email);
logFailedEmails(failedEmails);