Loops (v50)

Revision 50 of this benchmark created by Conor Malone on


Setup

var arr = [1, 2, 3, 4, 5, 6, 7, 8, 9, 0];
    arr = arr.concat(arr, arr, arr, arr, arr, arr, arr, arr, arr);

Test runner

Ready to run.

Testing in
TestOps/sec
standard for loop
for (var i = 0; i< arr.length; i++) {
  arr[i];
};
ready
Reverse for loop
var len = arr.length;
for (var i = len; i--;) {
  arr[i];
};
ready

Revisions

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