Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
javascript array copy test
(version: 0)
Compare the new ES6 spread operator with the traditional slice() method
Comparing performance of:
Array.prototype.slice vs spread operator vs Array from
Created:
4 years ago
by:
Guest
Jump to the latest result
Tests:
Array.prototype.slice
var params = [1,2,3,4,5]; var other = params.slice();
spread operator
var params = [1,2,3,4,5]; var other = [ ...params ];
Array from
var params = [1,2,3,4,5]; var other = Array.from(params);
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (3)
Previous results
Fork
Test case name
Result
Array.prototype.slice
spread operator
Array from
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.prototype.slice vs spread operator With slightly bigger array
Array.prototype.slice vs spread operator for Array copy
Javascript array cloning slice vs spread
Array.prototype.slice vs spread operator on a bigger array
Slice vs spread 10k items 2024
Comments
Confirm delete:
Do you really want to delete benchmark?