JavaScript · Middle · Question 17 of 75

How does Promise.all behave if one of the promises rejects?

Explanation

Promise.all is "all or nothing". The other operations aren't cancelled; their results are just no longer needed. If all outcomes matter, use Promise.allSettled; for the first success, Promise.any; for the first settled, Promise.race.

Further reading

Problem with a question

JavaScript · Middle · question 17

Test yourself

Take the JavaScript · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz