array iteration

Benchmark created on


Preparation HTML

<script>
  var array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0]
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
for
for (var i = 0, l = array.length; i < l; i++) {
 array[i] == 1;
}
ready
forEach
array.forEach(function(v) {
 v == 1;
});
ready
for-in
for (var i in array) {
 array[i] == 1;
}
ready

Revisions

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