Array concat vs spread operator vs push for array flat implementation

Compare the new ES6 spread operator with the traditional concat() method and push
3 years ago
User agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 11_2_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36
Test name Executions per second
native flat 133663.3 Ops/sec
flatPush 130928.5 Ops/sec
flatConcat 113044.2 Ops/sec
flatSpread 139164.9 Ops/sec
Script Preparation code:
Tests:
  • native flat

  • flatPush

  • flatConcat

  • flatSpread

Open this result on MeasureThat.net