While Sugar

Benchmark created by Eric on


Preparation HTML

<script>
  var knight, knights = ['King Arthur', 'Sir Lancelot', 'Patsy', 'Sir Robin', 'Sir Bedevere', 'Sir Galahad'],
      i = 0,
      j = 0;
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
for loop sugar
for (; knight = knights[i++];) {
  console.log(knight + ': life shortened by a hare.');
}
ready
while loop sugar
while (knight = knights[j++]) {
  console.log(knight + ': life shortened by a hare.');
}
ready

Revisions

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