Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36 Edg/128.0.0.0
Chrome 128
Windows
Desktop
one year ago
ForEach and Mutate (for .. in loop)
126K/s
Mutate with Object.assign
77K/s
Reduce and Spread
45K/s
Foreach and Mutate (Object.assign)
6K/s
View exact numbers
Test name Executions per second
ForEach and Mutate (for .. in loop) 125,906 Ops/sec
Mutate with Object.assign 77,372 Ops/sec
Reduce and Spread 45,164 Ops/sec
Foreach and Mutate (Object.assign) 6,422 Ops/sec
Script Preparation code:
Tests: