What is the difference between `Promise.any()` and `Promise.race()`?

JavaScript Professional Medium

JavaScript Professional — Medium

What is the difference between `Promise.any()` and `Promise.race()`?

Key points

  • Promise.any() resolves with the first fulfilled promise
  • Promise.any() rejects only if ALL promises reject
  • Promise.race() settles with the first settled promise, including rejections

Ready to go further?

Related questions