5 ms·
incorrect. `await` is a reserved word only in async contexts, the UI thread event loop still runs while `await`ing.
by bmeck 10y ago
incorrect. `await` is a reserved word only in async contexts, the UI thread event loop still runs while `await`ing.
- egeozcan 10y agoIf you run an await as a first thing in the top-level, you have nothing in the event loop to run. Await blocks everything after itself, and that is very dangerous if done on the top-level.
- BinaryIdiot 10y agoIn that script, yes. But in JavaScript you can have multiple scripts :)