Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36
Chrome 118
Windows
Desktop
9 months ago
Test name Executions per second
Object.Assign() 1045.7 Ops/sec
For-In Loop 1158.8 Ops/sec
Object.Entries() with For-Each Loop 1570.5 Ops/sec
Object.Keys() with For-Each Loop 1239.0 Ops/sec
Spread 986.0 Ops/sec
Script Preparation code:
Tests:
  • Object.Assign()

  • For-In Loop

  • Object.Entries() with For-Each Loop

  • Object.Keys() with For-Each Loop

  • Spread