The _______ method returns a Promise that resolves or rejects as soon as one of the promises in an iterable resolves or rejects, with the value or reason from that promise.

  • Promise.race()
  • Promise.all()
  • Promise.any()
  • Promise()
The correct answer is Promise.race(). This method takes an iterable of promises and returns a new promise that settles as soon as one of the input promises resolves or rejects. It's useful when you want to perform an action as soon as any of several asynchronous tasks completes.
Add your answer
Loading...

Leave a comment

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