Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36
Chrome 112
Windows
Desktop
one year ago
Test name Executions per second
Using array spread 3421113.0 Ops/sec
Using clone and push loop 387392.4 Ops/sec
Using clone and push spread 3635719.0 Ops/sec
Using clone and push spread 2 2790272.5 Ops/sec
Using push spread 2533197.5 Ops/sec
Using array concat 2896020.0 Ops/sec
Using array concat (2) 2143875.0 Ops/sec
Script Preparation code:
Tests:
  • Using array spread

  • Using clone and push loop

  • Using clone and push spread

  • Using clone and push spread 2

  • Using push spread

  • Using array concat

  • Using array concat (2)