Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36 Edg/130.0.0.0
Chrome 130
Windows
Desktop
one month ago
Test name Executions per second
Create a copy using the spread operator 6546440.0 Ops/sec
Create a copy using array.concat 1745822.6 Ops/sec
Create a copy manually in a loop using push 147850.8 Ops/sec
Create a copy manually in a loop by index 161804.0 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