56
I'm confused about when to use Promise.all() vs Promise.allSettled() in JavaScript.
From what I understand:
- Promise.all() fails fast if any promise rejects
- Promise.allSettled() waits for all promises
Can someone explain with practical examples when I should use each one? What are the pros and cons?