concat vs spread operator vs push
Compare the new ES6 spread operator with the traditional concat() method and push
2 years ago
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.80 Safari/537.36 Edg/98.0.1108.50
Test name |
Executions per second |
Array.prototype.concat |
7993637.0 Ops/sec |
spread operator |
35844440.0 Ops/sec |
Push |
52250540.0 Ops/sec |
Tests:
-
Array.prototype.concat
-
spread operator
-
Push
Open this result on MeasureThat.net