Problem
Implement promiseRace(promises) that settles (resolves or rejects) as soon as the first promise settles, adopting its outcome.
function promiseRace(promises) {
// your code
}
JavaScript interview practice: Settle with the first promise that settles — whether it fulfils or rejects.
Implement promiseRace(promises) that settles (resolves or rejects) as soon as the first promise settles, adopting its outcome.
function promiseRace(promises) {
// your code
}
Unlock the in-browser editor, test cases, and model solution with Mentoxis Premium.
Unlock with Premium