await
turns Promise (future value) into a value/error.
Last updated
Was this helpful?
turns Promise (future value) into a value/error.
Last updated
Was this helpful?
⟩ ⟩ await
⟩ ⟩ ⟩ ⟩ ⟩ await
(⭐️ ES2017) (primary expression) (unary operator) turns a Promise / 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
modern browsers allow top-level await in .