Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4919.0 Safari/537.36
Chrome 101
Linux
Desktop
2 years ago
Test name Executions per second
Reduce and Spread 40979.7 Ops/sec
ForEach and Mutate (for .. in loop) 129387.1 Ops/sec
Mutate with Object.assign 84250.0 Ops/sec
Foreach and Mutate (Object.assign) 6486.8 Ops/sec
Script Preparation code:
Tests:
  • Reduce and Spread

  • ForEach and Mutate (for .. in loop)

  • Mutate with Object.assign

  • Foreach and Mutate (Object.assign)