Fastest way to merge two arrays

Benchmark created on


Setup

let original = ['hello', 1, 2, 3, { randomThing: 'buh' }];

const args = [{ one: 'thing1', two: 'thing2' }];

Test runner

Ready to run.

Testing in
TestOps/sec
Concat
original = original.concat(args);
ready
Spread
const newArr = [...original, ...args];
ready
Push
original.push.apply(args);
ready

Revisions

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