push vs concat

Benchmark created on


Setup

const array = new Array(1000000).fill(0).map((item, index) => index);
const extraArray = array.slice();

Test runner

Ready to run.

Testing in
TestOps/sec
push
for (let item of extraArray) {
	array.push(item);
}
ready
concat
array.concat(extraArray)
ready

Revisions

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