array iteration (v98)

Revision 98 of this benchmark created on


Preparation HTML

<script>
  var i, values = [],
      sum = 0;
  for (i = 0; i < 100; i++) {
    values.push(i);
  }

  function add(val) {
    sum += val;
  }
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
forEach
values.forEach(add);
ready
for i
for (var i = 0; i < values.length; ++i) {
  add(values[i]);
}
ready

Revisions

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