CodeIntermediate

async function

Also known as async · async keyword · async/await · await

A JavaScript function declared with async that always returns a promise and can use await to pause its own execution for a result.

In the real world

async function load() { const r = await fetch('/api/terms'); return r.json(); } returns a promise.

Related

Go a little deeper