Test spread or push

Benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
spread
const arr = new Array(1000).fill("0");
let newArr = [];

for (const i of arr) {
	newArr = [...newArr, i];
}
ready
push
const arr = new Array(1000).fill("0");
let newArr = [];

for (const i of arr) {
	newArr.push(i);
}
ready

Revisions

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