array concatenation

Benchmark created on


Setup

let arr1 = [];
let arr2 = [];
for(let i = 0;i < 100;i++) arr1.push(i);
for(let i = 0;i < 200;i += 2) arr2.push(i);

Test runner

Ready to run.

Testing in
TestOps/sec
concat
arr1 = arr1.concat(arr2);
ready
push 1
Array.prototype.push.apply(arr1, arr2);
ready
push 2
arr1.push(...arr2);
ready

Revisions

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