Promise.any()
takes an iterable of
Promise
objects and, as soon as one of the promises in the iterable fulfils, returns a single promise that resolves with the value from that promise. If no promises in the iterable fulfil (if all of the given promises are rejected), then the returned promise is rejected with an
AggregateError
, a new subclass of
Error
that groups together individual errors. Essentially, this method is the opposite of
Promise.all()
.
Warning!
Promise.any()
method is experimental and not fully supported by all browsers and platforms. It is currently in
stage 4 of the TC39 process
.
Promise
Function
Object
Object.prototype.__defineGetter__()
Object.prototype.__defineSetter__()
Object.prototype.__lookupGetter__()
Object.prototype.__lookupSetter__()
Object.prototype.hasOwnProperty()
Object.prototype.isPrototypeOf()
Object.prototype.propertyIsEnumerable()
Object.prototype.toLocaleString()
Object.prototype.toSource()
Object.prototype.toString()
Object.prototype.valueOf()
Object.setPrototypeOf()