Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36
Chrome 127
Mac OS X 10.15.7
Desktop
one year ago
ForEach and Mutate (for .. in loop)
238K/s
Mutate with Object.assign
160K/s
Reduce and Spread
57K/s
Foreach and Mutate (Object.assign)
14K/s
View exact numbers
Test name Executions per second
ForEach and Mutate (for .. in loop) 237,613 Ops/sec
Mutate with Object.assign 159,613 Ops/sec
Reduce and Spread 57,020 Ops/sec
Foreach and Mutate (Object.assign) 13,933 Ops/sec
Script Preparation code:
Tests: