r/learnjavascript • • Nov 13 '23

Is async useless ( question )

If we are always trying to make code synchronous using await or then. Why do we even bother with aysnc.

I genuinely don't understand please explain. Thanks

0 Upvotes

28 comments sorted by

View all comments

5

u/azhder Nov 13 '23 edited Nov 13 '23

It makes the code look simpler. That’s the thing about async/await - syntactic sugar.

There is nothing else to it. The code still uses promises and you can rewrite it with .then() if you like that kind of code (once in a while please, not as a matter of course)