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.
Loading...
Related Quiz
- The HTTP status code ________ indicates that the request has succeeded.
- In order to create a private variable in JavaScript, you might utilize a ________.
- Which keyword is used to declare a variable with block scope?
- _________ is the organization that now oversees the ECMAScript specification, which serves as the basis for JavaScript.
- Which property is used to change the text content of a selected element?