Array Spread vs Concat (v5)

Revision 5 of this benchmark created on


Setup

const b = Array(1000).fill(4)

Test runner

Ready to run.

Testing in
TestOps/sec
Spread
const a = [1,2,3]
const c = {
	a: a
}

c["a"].push(...b)
ready
Concat
let a = [1,2,3]
const c = {
	a: a
}

c["a"] = c["a"].concat(b)
ready

Revisions

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