Javascript array concat vs push (v19)

Revision 19 of this benchmark created by Krinkle 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

Revisions

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