spread vs unshift

Benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
spread operator
const arr1 = [0,1,2,3,4];
const arr2 = [5,6,7,8,9];
const arr3 = [...arr1, ...arr2];
ready
unshift
const arr1 = [0,1,2,3,4];
const arr2 = [5,6,7,8,9];
arr2.unshift(...arr1);
ready

Revisions

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