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:
7 months ago
by:
Guest
Go 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:
7 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
Array.prototype.slice
8.6M/s
Spread operator
5.3M/s
View exact numbers
Test name
Executions per second
✓
Array.prototype.slice
8,571,469 Ops/sec
Spread operator
5,310,442 Ops/sec
Related benchmarks
Array.prototype.slice vs spread operator.
Array.prototype.slice vs spread operator With slightly bigger array
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?