Var in, var out

Benchmark created on


Setup

var array = []
    for (i = 0; i < 100; i++) {
      array.push(i);
    }

Test runner

Ready to run.

Testing in
TestOps/sec
var in
var total = 0;
array.forEach(function(value) {
  var i = value * 2;
  total += i;
})
ready
var out
var total = 0;
var i;
array.forEach(function(value) {
  i = value * 2;
  total += i;
})
ready

Revisions

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