3 ms·
> Top-level async would make asynchronous IO no different from synchronous IO! It's the worst of both worlds. No it's not. Synchronous IO blocks everything. As
by thomasfoster96 10y ago
> Top-level async would make asynchronous IO no different from synchronous IO! It's the worst of both worlds.
No it's not. Synchronous IO blocks everything. Asynchronous IO with top level await would still allow things queued in the event loop to execute. Plus, top level await + Promise.all would allow you to do operations concurrently, something that synchronous doesn't.