Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Array concat vs spread operator vs push222
(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
Created:
2 years ago
by:
Guest
Jump to the latest result
Script Preparation code:
var arr = Array.from({length: 10000}).map(x => 1);
Tests:
Array.prototype.concat
var params = [ "hello", true, 7 ]; var other = arr.concat(params);
spread operator
var params = [ "hello", true, 7 ] var other = [ ...arr, ...params ]
Push
var params = [ "hello", true, 7 ]; var other = arr.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
Push
Fastest:
N/A
Slowest:
N/A
Latest run results:
No previous run results
This benchmark does not have any results yet. Be the first one
to run it!
Comments
Confirm delete:
Do you really want to delete benchmark?