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
21 days ago
Test name Executions per second
Get copy using Object.create 737875.7 Ops/sec
Get copy using spread 8060671.0 Ops/sec
Get copy using structuredClone 188511.4 Ops/sec
Copy manually using for loop 294576.0 Ops/sec
Copy using JSON.stringify 153584.7 Ops/sec
Script Preparation code:
Tests:
  • Get copy using Object.assign

  • Get copy using spread

  • Get copy using structuredClone

  • Copy manually using for loop

  • Copy using JSON.stringify