Hacker News new | ask | show | jobs
by egeozcan 3568 days ago
If 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.
1 comments

In that script, yes. But in JavaScript you can have multiple scripts :)
> in JavaScript you can have multiple scripts

You mean, you can embed multiple script elements in HTML? Yes. But allowing global await in ES spec means also enabling it in node.

or you could just do `import('a'); import('b');` to load `a` and `b` in parallel