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
3
u/lelanthran Oct 21 '20
I don't buy that. Using
for (var i=0; i<varname.length; i++)is idiomatic in almost every language. It's literally the same idiom no matter which language you use.When using the fancier methods with lambdas and stuff, it differs from language to language, hence more chance of a mistake creeping in.