Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36
Chrome 130
Mac OS X 10.15.7
Desktop
one month ago
Test name Executions per second
Create a copy using the spread operator 5092517.0 Ops/sec
Create a copy using array.concat 1387774.4 Ops/sec
Create a copy manually in a loop using push 111733.8 Ops/sec
Create a copy manually in a loop by index 121042.9 Ops/sec
Script Preparation code:
Tests:
  • Create a copy using the spread operator

  • Create a copy using array.concat

  • Create a copy manually in a loop using push

  • Create a copy manually in a loop by index