To handle multiple Promises concurrently and respond when the first one is fulfilled, use Promise._________.

  • all()
  • race()
  • any()
  • first()
The correct method is race(). It returns a promise that fulfills or rejects as soon as one of the promises in the iterable fulfills or rejects, with the value or reason from that promise. This is useful for handling scenarios where you want to respond to the first promise that resolves.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *