Concat v. Spread (v2)

Revision 2 of this benchmark created on


Setup

const arr1 = Array.apply({ key: 'value' }, new Array(100))
const arr2 = Array.apply({ key: 'value' }, new Array(100))

Test runner

Ready to run.

Testing in
TestOps/sec
Concat
const newArr = arr1.concat(arr2)
ready
Spread
const newArr = [
  ...arr1,
  ...arr2
]
ready
Push Prototype
Array.prototype.push.apply(arr1, arr2)
ready
Push
arr1.push(...arr2)
ready

Revisions

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