array's for-in

Benchmark created on


Preparation HTML

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

Test runner

Ready to run.

Testing in
TestOps/sec
for in data1
for (var i in data1) {
 data1[i];
}
ready
for in data2
for (var i in data2) {
 data2[i];
}
ready
normal data1
for (var i = 0, l = data1.length; i < l; i++) {
 data1[i];
}
ready

Revisions

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