Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Array slice() vs. spread operator
(version: 1)
Comparing ES6 spread operator with the slice() method
Comparing performance of:
Array.prototype.slice vs Spread operator
Created:
3 months ago
by:
Guest
Jump to the latest result
Script Preparation code:
var orig = Array(100).fill('some string');
Tests:
Array.prototype.slice
var copy = orig.slice();
Spread operator
var other = [ ...orig ]
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
Array.prototype.slice
Spread operator
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
3 months ago
)
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.1 Safari/605.1.15
Browser/OS:
Safari 26 on Mac OS X 10.15.7
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
Array.prototype.slice
8571469.0 Ops/sec
Spread operator
5310442.0 Ops/sec
Related benchmarks:
Array.prototype.slice(0) vs spread operator
Array.prototype.slice vs spread operator.
Array.prototype.slice vs spread operator with length limit
arr.slice() vs spread operator
Array.prototype.slice vs spread operator With slightly bigger array
Array.prototype.slice vs spread operator different syntax
Which is faster Array.prototype.slice vs spread operator
Array.prototype.slice vs spread operator on a bigger array
Array.prototype.slice vs spread operator performance
Array.prototype.slice vs spread operator 73 3
Comments
Confirm delete:
Do you really want to delete benchmark?