await outside of async function doesn't throw error in console

  • A+

MDN says:

Remember, the await keyword is only valid inside async functions. If you use it outside of an async function's body, you will get a SyntaxError.

But that's not true.

Try this code in DevTools console, no errors, just result:

async function a(val) { return val; } await a(10) // await is not inside async function 10 

What's wrong with the code or docs?


It looks like it has been supported since 11/08/2017:

If you spy the


at line 129, they have the function for evaluating expressions marked as async:

async evaluateCommandInConsole 


:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: