Array concat vs spread operator vs push for strings
Compare the new ES6 spread operator with the traditional concat() method and push
4 years ago
User agent:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36
Test name |
Executions per second |
Array.prototype.concat |
7333170.0 Ops/sec |
spread operator |
32131320.0 Ops/sec |
Push |
25155050.0 Ops/sec |
Tests:
-
Array.prototype.concat
-
spread operator
-
Push
Open this result on MeasureThat.net