Array loop versus shift (v2)

Revision 2 of this benchmark created on


Preparation HTML

<script>
  var A = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J"], 
      B = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J"],
      i, j, s;
  
  
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
Loop
i = 0;
j = A.length;
for (i = i; i < j; i = i + 1) {
 s = A[i];
}
ready
Shift
var C = B.slice(0);
while (C.length) {
 s = C.shift();
}
ready

Revisions

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