Converting arguments to an array (v11)

Revision 11 of this benchmark created by Charmander on


Setup

var original = [];
    
    for(var i = 0; i < 1000; i++) {
        original[i] = i;
    }
    
    var push = Array.prototype.push;

Test runner

Ready to run.

Testing in
TestOps/sec
slice
original.slice();
ready
Array#push
var clone = [];

push.apply(clone, original);
ready
Array
Array.apply(null, original);
ready

Revisions

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