JavaScript · Senior · Question 55 of 75

What does Promise.any reject with when all promises reject?

Explanation

Since it waits for the first success, failure means "everything failed", so all reasons are kept. Check err instanceof AggregateError to log them.

Further reading

Problem with a question

JavaScript · Senior · question 55

Test yourself

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

Take this quiz