JavaScriptSyntax
Async / Await
Code example
async function load() {
const data = await getData();
}Waits for a promise inside an async function.
In JavaScript, async / await: waits for a promise inside an async function — async function load() { const data = await getData(); }
async function load() {
const data = await getData();
}async function load() {
const data = await getData();
}Waits for a promise inside an async function.
Use async function load() { const data = await getData(); }.
Use this pattern: async function load() { const data = await getData(); }
Yes. Use Copy code and adapt the example to your program.
No. The language syntax is the same across operating systems.