Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Array.prototype.slice with length vs spread operator
(version: 2)
Compare the new ES6 spread operator with the traditional slice() method
Comparing performance of:
Array.prototype.slice vs spread operator
Created:
one year ago
by:
Registered User
Go to the latest result
Tests:
Array.prototype.slice
var params = [ "hello", true, 7 ]; var other = params.slice(1, params.length);
spread operator
var params = [ "hello", true, 7 ] var other = [ ...params ]
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:
one year ago
)
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36
Browser/OS:
Chrome 131 on Mac OS X 10.15.7
View result in a separate tab
Embed
Embed Benchmark Result
spread operator
107.2M/s
Array.prototype.slice
64.9M/s
View exact numbers
Test name
Executions per second
✓
spread operator
107,158,056 Ops/sec
Array.prototype.slice
64,891,036 Ops/sec
Related benchmarks
Fixed Array.prototype.slice vs spread operator
Array.prototype.slice vs spread operator 73
Comments
Confirm delete:
Do you really want to delete benchmark?