Array concat vs spread operator vs push for array flat implementation

Compare the new ES6 spread operator with the traditional concat() method and push
2 years ago
User agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.61 Safari/537.36
Test name Executions per second
native flat 405369.7 Ops/sec
flatPush 196251.7 Ops/sec
flatConcat 216556.4 Ops/sec
flatSpread 259593.6 Ops/sec
Script Preparation code:
Tests:
  • native flat

  • flatPush

  • flatConcat

  • flatSpread

Open this result on MeasureThat.net