Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Array.prototype.concat vs push apply vs spread operator
Compare the new ES6 spread operator with the concat and apply method
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36
Browser:
Chrome 138
Operating system:
Windows
Device Platform:
Desktop
Date tested:
9 months ago
Test name
Executions per second
Using concat
13379905.0 Ops/sec
Using prototype.push.apply
34477092.0 Ops/sec
Using arr1.push.apply
38837304.0 Ops/sec
Using push spread operator
38052888.0 Ops/sec
Using spread operator
28727492.0 Ops/sec
Tests:
Using concat
const arr1 = ["test", true ,"concat", 791, "push"] const arr2 = [false, "es", 6, "spread operator", "measurethat.net"] const newArr = arr2.concat(arr1);
Using prototype.push.apply
const arr1 = ["test", true ,"concat", 791, "push"] const arr2 = [false, "es", 6, "spread operator", "measurethat.net"] Array.prototype.push.apply(arr1, arr2);
Using arr1.push.apply
const arr1 = ["test", true ,"concat", 791, "push"] const arr2 = [false, "es", 6, "spread operator", "measurethat.net"] arr1.push.apply(arr1, arr2);
Using push spread operator
const arr1 = ["test", true ,"concat", 791, "push"] const arr2 = [false, "es", 6, "spread operator", "measurethat.net"] arr1.push(...arr2)
Using spread operator
const arr1 = ["test", true ,"concat", 791, "push"] const arr2 = [false, "es", 6, "spread operator", "measurethat.net"] const newArr = [...arr1, ...arr2]