jsc

Benchmark created on


Setup

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

Test runner

Ready to run.

Testing in
TestOps/sec
Boucle
var sum = 0;
for (var i = 0; i < array.length; i++) {
  sum += array[i];
}
ready
Méthode
var sum = 0;
array.forEach(function(value) {
  sum += value;
});
ready

Revisions

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