JavaScript await Operator
The await operator pauses an async function until a promise settles, then gives back its result, or throws if the promise rejects.
Description
The await operator is used inside async functions (and at the top level of modules) to wait for a promise. It pauses the function until the promise settles, then evaluates to the fulfilled value; if the promise rejects, await throws the reason, which you can catch with try...catch. Non-promise values are returned as they are.
Pausing only affects the async function itself; the rest of the page keeps running. To run independent tasks in parallel, start them together and await Promise.all([...]), rather than awaiting each one in turn.
Errors in awaited promises can also be handled by attaching .catch() before awaiting, as in await load().catch(() => fallback), which keeps short operations on one line. Inside loops, await runs each iteration one after another, which is right when order matters; use Promise.all() with map() when iterations are independent.
Properties
- Operator
await- Category
- Unary
- Precedence
- 14 (1 is lowest, 18 is highest)
- Associativity
- right-to-left
Syntax
await expressionExample
Browser Support
The following information will show you the current browser support for the await operator. Hover over a browser icon to see the version that first introduced support for this operator.
Desktop





Tablets & Mobile





