allSettled: Waits for all promises. any: Fulfills when any fulfills, rejects if all reject.
Solution Code
JavaScript
Promise.allSettled([p1, p2]).then(results => {/*...*/});
Explanation
Improves error handling vs Promise.all which fails fast.Guided Hints
Compare with Promise.race
Browser support