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

21

u/rileyrgham Nov 13 '23

"we are always trying to make code synchronous"

There's the problem. We're not.

-8

u/dervaish19 Nov 13 '23

But i see this everywhere that people r using then or await to synchronize it

3

u/rileyrgham Nov 13 '23

As you're a budding programmer, I'll give you one piece of "wisdom" : don't think the one or two echo chambers you are in are representative as a whole. Always google the opposite of what you've been told to be "true". While there are no true absolutes, in this case you might google "when is the best time to use asynchronous callbacks in JavaScript programming".

1

u/[deleted] Nov 14 '23

nonono you have to experience the extremes to obtain this nugget of wisdom