foreach (v2)

Revision 2 of this benchmark created on


Preparation HTML

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

Test runner

Ready to run.

Testing in
TestOps/sec
length
var i;
for (i = 0; i < f.length; f++) {
 f[i];
}
ready
in
var i;
for (i in f) {
 if (i.hasOwnProperty(f)) {
  f[i];
 }
}
ready
length - while
var l = f.length;
while (l--) {
 f[l];
}
ready

Revisions

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