You say that the await keyword can only be used with functions that were declared with async.
Jerry Krusinski

You can await on a function that returns a promise, but the await keyword itself must be in a function that’s declared async.

For example, this works:

const sleep = ms => new Promise(res => setTimeout(res, ms));
async function trySleep() {
 await sleep(5000);

Show your support

Clapping shows how much you appreciated Ed Gauci’s story.