Async iterators and the for await..of loopBaseline · Widely available
Asynchronous iterator objects, such as those returned by promises or generator functions, are iterable with the for await .. of loop.
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: 155Edge
12–18Not supported
79+Supportedsince Jan 15, 2020
Current: 154Firefox
1–56Not supported
57+Supportedsince Nov 14, 2017
Current: 157Safari
1–11.1Not supported
12+Supportedsince Sep 17, 2018
Current: 27MobileChrome Android
18–62Not supported
63+Supportedsince Dec 5, 2017
Current: 155Firefox Android
4–56Not supported
57+Supportedsince Nov 28, 2017
Current: 157Safari iOS
1–11.3Not supported
12+Supportedsince Sep 17, 2018
Current: 27How to use
This feature is Baseline widely available — use it freely, no fallback needed.
Example
Full syntax and examples are on MDN: AsyncIterator.
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 (5). The overall table above shows when the whole feature works.
| Sub-feature | Chrome | Edge | Firefox | Safari | Chrome Android | Firefox Android | Safari iOS |
|---|---|---|---|---|---|---|---|
| AsyncIterator | 63 | 79 | 57 | 11.1 | 63 | 57 | 11.3 |
| AsyncIterator.@@asyncIterator | 63 | 79 | 57 | 11.1 | 63 | 57 | 11.3 |
| Symbol.asyncIterator | 63 | 79 | 57 | 11.1 | 63 | 57 | 11.3 |
| for_await_of | 63 | 79 | 57 | 12 | 63 | 57 | 12 |
| for_of.async_iterators | 63 | 12 | 57 | 7 | 63 | 57 | 7 |