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

It works for me in stable version of Chrome and in latest Chrome Canary:

function sleep(ms) { return new Promise(r => setTimeout(r, ms)); }
(async function main() { await sleep(2000); console.log(‘after 2s’); })()

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.