JavaScript · Middle · Question 18 of 75
What does Promise.allSettled return?
- ✓Correct answer: An array of
{ status, value | reason }objects, one per promise - 2Only the values of successful promises; errors are discarded
- 3The result of the first settled promise, successful or not
Explanation
allSettled never rejects: it waits for all promises and describes each outcome ('fulfilled' or 'rejected'). Handy when you need to run independent requests and show a partial result.