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 slice 13571694.0 Ops/sec
Using array spread 13359738.0 Ops/sec
Using array push and spread 6729948.0 Ops/sec
Using for loop and push 205932.4 Ops/sec
Using array concat 13048747.0 Ops/sec
Script Preparation code:
Tests:
  • Using array slice

  • Using array spread

  • Using array push and spread

  • Using for loop and push

  • Using array concat