Different for loops variable declaration

Benchmark created by Haopei Yang on


Test runner

Ready to run.

Testing in
TestOps/sec
var i, outside loop
var i;
for (i = 0; i < 10000; i++) {
  console.log(i);
}

 
ready
var i, inside loop
for (var i = 0; i < 10000; i++) {
  console.log(i);
}
ready

Revisions

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

  • Revision 1: published by Haopei Yang on