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 5019132.0 Ops/sec
Create a copy using array.concat 1642315.5 Ops/sec
Create a copy manually in a loop using push 139774.7 Ops/sec
Create a copy manually in a loop by index 157464.2 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