Black Lives Matter! ✊🏾

await

The await operator is used to wait for a Promise. It can only be used inside an async function. await (MDN)

Links about await

  1. JavaScript async and await in loops | Zell Liew

    posted on by Zell Liew

    I share some gotchas you have to watch out for when you use async and await in loops.

  2. Asynchronous stack traces: why await beats Promise#then() · Mathias Bynens

    posted on by Mathias Bynens

  3. await

    posted on by MDN

    The await operator is used to wait for a Promise. It can only be used inside an async function.

Code sample

async function f3() {
var y = await 20;
console.log(y); // 20
}