Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Array concat vs spread operator vs push - fork
(version: 1)
Compare the new ES6 spread operator with the traditional concat() method and push
Comparing performance of:
Array.prototype.concat vs spread operator vs Push
Created:
one year ago
by:
Guest
Jump to the latest result
Tests:
Array.prototype.concat
var params = [ "hello", true, 72312 ]; var other = params.reduce((acc, curr) => acc.concat(curr), []);
spread operator
var params = [ "hello", true, 7 ] var other = params.reduce((acc, curr) => [...acc, curr], []);
Push
var params = [ "hello", true, 7 ]; var other = params.reduce((acc, curr) => acc.push(curr) && acc, []);
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (3)
Previous results
Fork
Test case name
Result
Array.prototype.concat
spread operator
Push
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one year ago
)
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36
Browser/OS:
Chrome 132 on Mac OS X 10.15.7
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
Array.prototype.concat
5240528.5 Ops/sec
spread operator
21531456.0 Ops/sec
Push
90650160.0 Ops/sec
Related benchmarks:
Array.prototype.concat vs spread operator vs apply
Array concat vs double spread operator vs push
Array concat vs spread operator vs push321
Array concat vs spread operator vs push32323
Array concat vs spread operator vs push123123
Array concat vs spread operator vs push at the end
Array.prototype.concat vs spread operator vs push
Array concat vs spread operator vs push (via for loop)
Array concat vs spread operator vs push vs prototype.push.apply
Comments
Confirm delete:
Do you really want to delete benchmark?