for loop with variable vs for loop with calculation

Benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
Calculated
var arr = new Array(1000000);

for (var i; i < arr.length; i++) {}
ready
Pre calculated
var arr = new Array(1000000);
var length = arr.length;
for (var i; i < length; i++) {}
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.