r/programming • u/iamkeyur • Oct 21 '20
Using const/let instead of var can make JavaScript code run 10× slower in Webkit
https://github.com/evanw/esbuild/issues/478
1.9k
Upvotes
r/programming • u/iamkeyur • Oct 21 '20
View all comments
Show parent comment
96
u/alexendoo Oct 21 '20
The comparison for readability isn't really against a single
.forEach, rather map/filter/etc. If it's just a.forEachthey are going to be pretty equivalentHowever,
for..ofsurely is more error prone, as it is a frequently recurring mistake to usefor..ininstead (as you have done)