forearchwhile

Benchmark created on


Preparation HTML

<script>
  var a = { a: 1, b: 2, c: 3 },
      b = [ 1, 2, 3 ];
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
ForEach
var i;

for ( i in a ) { console.debug(a[i]) };
ready
While
var i = b.length;

while ( i-- ) { console.debug(b[i]) };
ready

Revisions

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