coderef

Async generatorsBaseline · Widely available

Async generator functions (async function*) create iterators that return multiple promises, one after another, on-demand.

Supported in all major browsers for at least 30 months — safe to use without fallbacks. Baseline since Jan 15, 2020. Widely available since Jul 15, 2022.

Browser support

DesktopChrome
1–62Not supported
63+Supportedsince Dec 6, 2017
Current: 155
Edge
12–18Not supported
79+Supportedsince Jan 15, 2020
Current: 154
Firefox
1–56Not supported
57+Supportedsince Nov 14, 2017
Current: 157
Safari
1–11.1Not supported
12+Supportedsince Sep 17, 2018
Current: 27
MobileChrome Android
18–62Not supported
63+Supportedsince Dec 5, 2017
Current: 155
Firefox Android
4–56Not supported
57+Supportedsince Nov 28, 2017
Current: 157
Safari iOS
1–11.3Not supported
12+Supportedsince Sep 17, 2018
Current: 27

How to use

This feature is Baseline widely available — use it freely, no fallback needed.

Example

Full syntax and examples are on MDN: AsyncGenerator.

Feature detection

JS · check before using
// Syntax can't be tested with an if-statement — an unsupported
// browser fails to parse the whole script. Either transpile for older
// targets (e.g. Babel/TypeScript/esbuild), or probe in isolation:
let supported = true;
try {
  new Function("/* code that uses the syntax */");
} catch {
  supported = false;
}

This is a language syntax feature.

Sub-features

Support for each part of the feature (9). The overall table above shows when the whole feature works.

Sub-featureChromeEdgeFirefoxSafariChrome AndroidFirefox AndroidSafari iOS
AsyncGenerator63795512635512
AsyncGenerator.next63795512635512
AsyncGenerator.return63795512635512
AsyncGenerator.throw63795512635512
AsyncGeneratorFunction63795512635512
AsyncGeneratorFunction.AsyncGeneratorFunction63795512635512
javascript.functions.method_definitions.async_generator_methods63795712635712
async_generator_function63795712635712
async_generator_function63795712635712