At their core, both Promise.all() and Promise.race() are concurrency methods. They let you hand off multiple asynchronous tasks (like API requests, file reads, or timers) at the same time and control how you want to handle their results. The easiest way to think about them is that Promise.all() is a team effort, while Promise.race() is a competition.
Rejected: If any of the promise is rejected it returns single error object from that specific failed promise. (Any remaining or successful promises are ignored).
Resolved: When every single promise succeeds it resolves, It returns an array of results in the exact same order as the input array (regardless of which one finished first).
Resolvesd: fulfils when any of the promises are fulfilled, It returns the single value of that fastest promise.
Rejects: rejects when any of the promises are rejected. Returns the single error object of that fastest promise.
Resolves: When every single promise finishes (some can succeed, some can fail). It never rejects.
Returns: An array of objects describing the outcome of each promise. Each object has a status. { status: "fulfilled/rejected", value: result }
Even if every single input promise fails, Promise.allSettled() will still resolve with an array of rejection objects.
Rejects: rejects when all of the promises are rejected. It returns An AggregateError object. You can access an array of all the individual errors using error.errors.
Resolves: As soon as the first successful promise finishes. It returns the single value of that fastest successful promise. (It completely ignores any faster promises that failed).