Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Array.prototype.concat vs spread operator vs push test
(version: 1)
Comparing performance of:
Array.prototype.concat vs spread operator vs array push with spread
Created:
8 months ago
by:
Guest
Jump to the latest result
Tests:
Array.prototype.concat
var original = [ 1, 2 ] var params = [ "hello", true, 7 ]; var other = original.concat(params);
spread operator
var original = [ 1, 2 ] var params = [ "hello", true, 7 ] var other = [ ...original, ...params ]
array push with spread
var original = [ 1, 2 ] var params = [ "hello", true, 7 ]; var other = (original).push(...params);
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
array push with spread
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
8 months ago
)
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36
Browser/OS:
Chrome 139 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
27897676.0 Ops/sec
spread operator
62072688.0 Ops/sec
array push with spread
101050304.0 Ops/sec
Related benchmarks:
Array.prototype.concat vs spread vs push 08072019
updating the existing value of array using concat vs spread operator vs push
Array concat vs spread operator vs push 2 arrays
Array concat vs spread operator vs push vs new array spread
Array concat vs spread operator vs push vs splice vs for-each push vs for-of push
Array concat vs spread operator vs push - append
Array concat vs spread operator vs push - V2
Array multi concat vs spread operator
Array.prototype.concat vs push with spread operator
Comments
Confirm delete:
Do you really want to delete benchmark?