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