2 ms·
Callbacks have been in Javascript since the beginning, and await is basically syntactic sugar for that. Having everything switch to blocking and have to start
by Thorrez 5y ago
Callbacks have been in Javascript since the beginning, and await is basically syntactic sugar for that.
Having everything switch to blocking and have to start using mutexes and other multithreading primitives would be a giant change to the language.
- int_19h 5y agoCallbacks have been there, but most code wasn't written with that in mind. And you still need some synchronization in async code - even if it's all scheduled on a single thread - due to re-entrancy issues.