array merge

Benchmark created on


Setup

let array1 = [];
let array2 = [];

for(let i=0;i<1000;i++){
	array1[i]=i;
	array2[i]=i+i;
}

Test runner

Ready to run.

Testing in
TestOps/sec
...
array1.push(...array2);
ready
for loop
for(let i=0;i<array2.length;i++)
	array1.push(array2[i]);
ready
concat
array1 = array1.concat(array2);
ready

Revisions

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