Promise.any and AggregateError

Promise.any() accepts an iterable of promises and returns a promise that is fulfilled by the first given promise to be fulfilled, or rejected with an AggregateError holding the rejection reasons if all of the given promises are rejected. AggregateError is a support class that aggregates one or more errors into a single object.

Motivation

This rounds out standard JS support for commonly available Promise combinators already available in userland libraries.

Documentation

Specification

Editor's draft

Status in Chromium

Blink>JavaScript


Enabled by default (tracking bug) in:

  • Chrome for desktop release 85
  • Chrome for Android release 85
  • Android WebView release 85

Consensus & Standardization

After a feature ships in Chrome, the values listed here are not guaranteed to be up to date.

Owners

Search tags

Promise.any,

Last updated on 2020-10-25