Array.prototype.slice vs spread operator with length limit
Compare the ES6 spread operator with the traditional slice() method
2 years ago
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36
Test name |
Executions per second |
Array.prototype.slice |
1045389.1 Ops/sec |
spread operator |
191126.2 Ops/sec |
Tests:
-
Array.prototype.slice
-
spread operator
Open this result on MeasureThat.net