Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Array concat vs spread operator vs push with large arrays with prepared vars
(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:
window.a = new Array(500000).fill(0); window.b = new Array(10000).fill(0);
Tests:
Array.prototype.concat
var other = window.a.concat(window.b);
spread operator
var other = [ ...window.a, ...window.b ]
Push
var other = window.a.push(...window.b);
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?