News for hackers. Stuff that matters.
Re:JavaScript Promises from the Ground Up by gabrielsroka on Thursday July 18, 2024 @06:38PM (#41000404)
> the await keyword is syntactic sugar for the .then() callback:

async/await is not just syntactic sugar. See

https://news.ycombinator.com/item?id=23701736

And the rest of thread

Re:JavaScript Promises from the Ground Up by rauschma on Friday July 19, 2024 @02:43PM (#41009703)
It depends on what you mean by syntactic sugar. I follow this definition: https://en.wikipedia.org/wiki/Syntactic_sugar

You can indeed translate an async function to an equivalent function that uses .then() but it’s a radical change, not syntactic sugar (as I use that term).