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