for-vs-while

Benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
for
for (var i = 0; i < items.length; i++) {

  process(items[i]);

}
ready
while
var j = 0;

while (j < items.length) {

  process(items[j++]]);

}
ready
do-while
var k = 0;

do {

  process(items[k++]);

} while (k < items.length);
ready

Revisions

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