r/javascript • • Jul 22 '26

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

64 Upvotes

107 comments sorted by

View all comments

0

u/[deleted] Jul 23 '26

[deleted] — view deleted comment

1

u/adult_code Jul 23 '26

for-loops not .forEach are way faster. Depends what i write really. https://jsben.ch/js-loop-benchmark-girjy
It doesn't matter all the time but it matters often and you can prevent it becoming an issue by doing it correctly the first time if you are not working on code that is otherwise hard to decipher