Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Array concat vs spread operator vs push performance test
(version: 0)
Comparing performance of:
Spread vs Concat vs Push with spread
Created:
2 years ago
by:
Guest
Jump to the latest result
Script Preparation code:
const a = Array.from({ length: 50000 }, (_, i) => i); const b = Array.from({ length: 50000 }, (_, i) => i);
Tests:
Spread
const c = [...a, ...b]; console.log(c.length);
Concat
const c = a.concat(b); console.log(c);
Push with spread
a.push(...b); console.log(a.length);
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (3)
Previous results
Fork
Test case name
Result
Spread
Concat
Push with spread
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?