What does `Promise.all()` do and what happens if one promise rejects?

JavaScript Associate Medium

JavaScript Associate — Medium

What does `Promise.all()` do and what happens if one promise rejects?

Key points

  • Promise.all() waits for all promises to resolve
  • If any promise rejects, the entire Promise.all() rejects
  • Returns an array of results from all promises
  • Ensures all promises are completed before resolving

Ready to go further?

Related questions