Array concat vs spread operator vs push with objects
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; rv:93.0) Gecko/20100101 Firefox/93.0
Test name |
Executions per second |
Array.prototype.concat |
7502277.5 Ops/sec |
spread operator |
8754404.0 Ops/sec |
Push |
6623293.0 Ops/sec |
Tests:
-
Array.prototype.concat
-
spread operator
-
Push
Open this result on MeasureThat.net