Run details:
Mozilla/5.0 (X11; Linux x86_64; rv:150.0) Gecko/20100101 Firefox/150.0
Firefox 150
Linux
Desktop
3 months ago
Benchmark.js
forEach
3K/s
Reduce (reuse object)
3K/s
Map
1K/s
Object.fromEntries
383/s
Object.assign
373/s
Reduce (creating temporary objects)
0/s
View exact numbers
Test name Executions per second
forEach 3,417 Ops/sec
Reduce (reuse object) 2,842 Ops/sec
Map 1,008 Ops/sec
Object.fromEntries 383 Ops/sec
Object.assign 373 Ops/sec
Reduce (creating temporary objects) 0 Ops/sec
Script Preparation code:
Tests: