popvsshift

Benchmark created on


Setup

var i = 0, arr = [];
    while (i < 100) {
      arr[i] = ++i;
    }

Test runner

Ready to run.

Testing in
TestOps/sec
Pop
var a = arr.slice();
while (a.pop()) { }
ready
Shift
var a = arr.slice();
while (a.shift()) { }
ready
Length
var a = arr.slice();
a.length = 0;
ready

Revisions

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