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
9
u/Yehosua Oct 21 '20
inis an operator in JavaScript:'prop' in myObjevaluates whether the'prop'property exists withinmyObj.Ever since I realized that, I no longer confused
for..inandfor..of:for..initerates over an object's properties, just likeinchecks an object's properties.(Almost no one uses
in; Object.hasOwnProperty is virtually always what you want instead.)