Javascript array concat vs push (v21)

Revision 21 of this benchmark created on


Setup

var arr1 = ['x', 'y', 'z'];
    var arr2 = ['a', 'b', 'c', 'd', 'e'];

Test runner

Ready to run.

Testing in
TestOps/sec
concat
arr1 = arr1.concat(arr2);
ready
push
arr1.push.apply(arr1, arr2);
ready
push2
arr1.push(arr2);
ready
push3
arr1.push.call(arr1,arr2)
ready

Revisions

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