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
Jump 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
Test name
Executions per second
Array.prototype.slice
64891036.0 Ops/sec
spread operator
107158056.0 Ops/sec
Related benchmarks:
Array.prototype.slice vs spread operator (correct)
Array.prototype.slice vs spread operator fixed
Array.prototype.slice vs spread operator 56
Array.prototype.slice vs spread operator (improved)
Array.prototype.slice vs spread operator (updated)
Array.prototype.slice vs spread operator (fixed)
Array.prototype.slice vs spread operator 20
Array.prototype.slice vs spread operator!111
Fixed Array.prototype.slice vs spread operator
Array.prototype.slice vs spread operator 73
Comments
Confirm delete:
Do you really want to delete benchmark?