coderef

Top-level awaitBaseline · Newly available

The await keyword, when used at the top level of a module (outside of an async function), delays parent module execution until after a promise fulfills.

Works in the latest version of every major browser, but older devices may not support it yet. Baseline since Sep 14, 2026.

Browser support

DesktopChrome
1–88Not supported
89+Supportedsince Mar 2, 2021
Current: 155
Edge
12–88Not supported
89+Supportedsince Mar 4, 2021
Current: 154
Firefox
1–88Not supported
89+Supportedsince Jun 1, 2021
Current: 157
Safari
1–26.6Not supported
27+Supportedsince Sep 14, 2026
Current: 27
MobileChrome Android
18–88Not supported
89+Supportedsince Mar 2, 2021
Current: 155
Firefox Android
4–88Not supported
89+Supportedsince Jun 1, 2021
Current: 157
Safari iOS
1–26.6Not supported
27+Supportedsince Sep 14, 2026
Current: 27

How to use

Every current browser supports this, but it only became Baseline on Sep 14, 2026. Use it as a progressive enhancement, or keep a fallback if you support older devices.

Example

JS
// In an ES module (type="module"), no async wrapper needed
const config = await fetch("/config.json").then((r) => r.json());
export default config;

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.