➕await
turns Promise (future value) into a value/error.
JS ⟩ statement ⟩ expression ⟩ operator ⟩ unary ⟩ await
(⭐️ ES2017) (primary expression) (unary operator) turns a Promise / thenable into a return value / thrown exception.
if resolves normally, await returns the result.
if rejected, it throws error (as if there were a
throw
statement at that line).
await can only be used inside an async function❗
modern browsers allow top-level await in modules.
Last updated