JavaScript · Senior · Question 55 of 75
What does Promise.any reject with when all promises reject?
- ✓Correct answer: An
AggregateErrorwhoseerrorsarray holds all rejection reasons - 2The first rejection reason
- 3
undefined
Explanation
Since it waits for the first success, failure means "everything failed", so all reasons are kept. Check err instanceof AggregateError to log them.