Message from JavaScript discussions

July 2017

— As far as I could tell it is efficient on normal arrays

— 

Https://stackoverflow.com/questions/17989270/for-loop-performance-storing-array-length-in-a-variable

— So I guess V8 is smart enough to optimize it nowadays

— Hm, but the dereference, is it that substantial?

— Run some tests? :P

— I know C++ does some great compiler opt in this kind of situation

— I hope JS does too at execution time

— I am now

— Https://jsperf.com/for-loop-research

— I am confused at these results tbh... lol

— It seems like using length right in there is pretty fast on modern browsers

— But not on older ones