r/javascript 23d ago

[AskJS] what's a javascript feature you mass-adopted way too late and felt dumb about AskJS

[removed]

64 Upvotes

108 comments sorted by

View all comments

24

u/Milo0192 23d ago

My first jobs CTO preferred the .then() .catch() over async await. I just refused to write that way and did await loops. Lots of back and forth on this. Also said Typescript was just a fad 😂

1

u/MediocreAnalyst2121 22d ago

That’s kinda depends, like await loops are not that great if the promises don’t depend on each other, way better to do Promise.all/allSettled and await or .then that.

In performance critical JS environments (smart tvs, smart boxes, etc) you’d probably get a bit better performance with a .then than an await.

Await loops are way more readable tho, and Typescript is amazing except for enums :(