Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36
Chrome 79
Linux
Desktop
4 years ago
Test name Executions per second
forEach #1 282769.7 Ops/sec
fromEntries and map #1 169824.0 Ops/sec
Object.assign and map #1 174174.1 Ops/sec
reduce #1 206056.0 Ops/sec
for 165339.7 Ops/sec
forEach #2 326083.5 Ops/sec
fromEntries and map #2 194788.5 Ops/sec
Object.assign and map #2 189904.4 Ops/sec
reduce #2 203768.5 Ops/sec
Script Preparation code:
Tests:
  • forEach #1

  • fromEntries and map #1

  • Object.assign and map #1

  • reduce #1

  • for

  • forEach #2

  • fromEntries and map #2

  • Object.assign and map #2

  • reduce #2