Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
concat vs spread operator vs push vs assign
(version: 0)
Compare the new ES6 spread operator with the traditional concat() method and push
Comparing performance of:
Array.prototype.concat vs spread operator vs Push vs Assign
Created:
one year ago
by:
Guest
Jump to the latest result
Tests:
Array.prototype.concat
var params = [ "hello", true, 7 ]; var other = [ 1, 2 ].concat(params);
spread operator
var params = [ "hello", true, 7 ] var other = [ 1, 2, ...params ]
Push
var params = [ "hello", true, 7 ]; var other = [ 1, 2 ].push(...params);
Assign
var params = [ "hello", true, 7 ]; var other = Object.assign([ 1, 2 ], params)
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (4)
Previous results
Fork
Test case name
Result
Array.prototype.concat
spread operator
Push
Assign
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one year ago
)
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36
Browser/OS:
Chrome 129 on Windows
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
Array.prototype.concat
13743646.0 Ops/sec
spread operator
61130456.0 Ops/sec
Push
68231712.0 Ops/sec
Assign
1874298.1 Ops/sec
Related benchmarks:
Array concat vs spread operator vs push
Array concat vs spread operator vs push for single element
Array.prototype.concat vs spread vs push operator
Array concat vs spread operator vs push single element
Array concat vs spread operator vs push 2
Array concat vs spread operator vs push vs object assign
Array concat vs spread operator vs push - Assign to same variable name
Comments
Confirm delete:
Do you really want to delete benchmark?