4 ms·
Two years after this article was written, async-await was introduced in Javascript as a solution to this problem. As far as I understand.
by habibur 5y ago
Two years after this article was written, async-await was introduced in Javascript as a solution to this problem. As far as I understand.
- dragonwriter 5y agoNope, async-await isn’t a solution to the problem, its just a slightly less annoying syntax sugar for defining and calling “red” functions, to which everything in the article applies.
- brazzy 5y agoThe article specifically mentions the async/await feature of C# and explains how it does not solve the problem, just make it less ugly to deal with.
- hsn915 5y agoasync/await in js exhibits the exact problem mentioned in the article.
- BiteCode_dev 5y agoNot really, you can call any async function in JS in sync code. It is automatically scheduled, and it will return a result immediately. This result is a Promise, that you can pass sync callbacks to, and keep the whole code away from async/await. You can also decide that async/await is nice, and just use that instead. I'm a Python dev, but that part is better in JS.