Problem
Implement promiseAny(promises) that resolves with the value of the first promise to fulfil. If all promises reject, reject with an AggregateError containing every rejection reason.
function promiseAny(promises) {
// your code
}
JavaScript interview practice: Resolve with the first fulfilled promise; reject with an AggregateError only if all reject.
Implement promiseAny(promises) that resolves with the value of the first promise to fulfil. If all promises reject, reject with an AggregateError containing every rejection reason.
function promiseAny(promises) {
// your code
}
Unlock the in-browser editor, test cases, and model solution with Mentoxis Premium.
Unlock with Premium