async Function

A function that always returns a Promise and allows await in its body.

What is async Function in JavaScript?

async Function — A function that always returns a Promise and allows await in its body.

async function loadOrder() {
    const response = await fetch("/api/order");
    return response.json();
}

Level: Journeyman · More JavaScript terms at this level

Updated