Given this code:
var arr = []; for (var i = 0; i < 10000; ++i) arr.push(1);
Forwards
for (var i =
Because in the first form you are accessing the property length of the array arr once for every iteration, whereas in the second you only do it once.
length
arr