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 13122495.0 Ops/sec
Using array spread 10786249.0 Ops/sec
Using array push and spread 5911474.5 Ops/sec
Using for loop and push 200561.4 Ops/sec
Using array concat 12681910.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