Skip to content

Tag: async-await

async function javascript is not running in background?

This output I want is this 1 2 3! in then but the async function behaves synchronously and does not let the 3! print until after the long loops are done executing. I thought if the async keyword is used, it runs the function inside in the background? I basically want the 2 long loops to run in the background.