Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Array concat vs spread operator vs push with more data
Compare the new ES6 spread operator with the traditional concat() method and push
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:136.0) Gecko/20100101 Firefox/136.0
Browser:
Firefox 136
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
Array.prototype.concat
264782.2 Ops/sec
spread operator
75444.9 Ops/sec
Push
32985.1 Ops/sec
Script Preparation code:
var array1 = [...Array(1000).keys()] var array2 = array1.map(i => i * 10)
Tests:
Array.prototype.concat
const result = array1.concat(array2);
spread operator
const result = [ ...array1, ...array2 ]
Push
const result = array1.push(...array2);