Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Array.prototype.concat vs push with spread operator vs push with apply
(version: 0)
Compare various methods of adding multiple elements to an array
Comparing performance of:
Array.prototype.concat vs push with spread operator vs push.apply
Created:
3 years ago
by:
Guest
Jump to the latest result
Tests:
Array.prototype.concat
const params = [ "hello", true, 7 ]; let target = [1, 2]; target = target.concat(params);
push with spread operator
const params = [ "hello", true, 7 ] const target = [1, 2]; target.push(...params);
push.apply
const params = [ "hello", true, 7 ] const target = [1, 2]; target.push.apply(target, params);
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (3)
Previous results
Fork
Test case name
Result
Array.prototype.concat
push with spread operator
push.apply
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!
Related benchmarks:
Array spread vs. push performance
Array.prototype.concat vs spread operator vs spread push vs multiple push
Array push vs spread vs concat
Array concat vs spread operator vs push for single values
Large Array concat vs Array.push vs push
Comments
Confirm delete:
Do you really want to delete benchmark?