Facebook Pixel

Does Promise.all reject if any promise rejects in JavaScript?

Yes. Promise.all rejects as soon as any promise rejects (fast fail). The other promises continue running (they are not cancelled), but their results are ignored. Use Promise.allSettled if you want all results regardless of failures.

Verify This Answer

Cross-check this information using these trusted sources:

More FAQs in Promise.all: Examples and Use Cases in JavaScript

It runs all promises in parallel and waits for all to fulfill. If any rejects, the whole thing rejects (fast fail). Results are in the same order as the input promises. Non-promise values are passed through.

An empty array []. Promise.all with an empty array resolves immediately (there is nothing to wait for). This is useful when you dynamically build an array and it might be empty.

Yes. Non-promise values are passed through as-is. Promise.all([1, Promise.resolve(2), 3]) resolves to [1, 2, 3]. This is useful for mixing sync and async values.

Still have questions?

Browse all our FAQs or reach out to our support team

Want to upskill yourself?

Our courses are taking a Coffee break, but your curiosity shouldn't. Stay engaged with namastedev linkedin, youtube, discord and other resources while you wait.

0
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.