Run details:
Mozilla/5.0 (Linux; Android 9; SM-A705YN) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.89 Mobile Safari/537.36
Chrome Mobile 84
Android
Mobile
4 years ago
Test name Executions per second
forEach #1 473560.2 Ops/sec
fromEntries and map #1 309609.7 Ops/sec
Object.assign and map #1 272936.5 Ops/sec
reduce #1 302017.4 Ops/sec
for 229987.8 Ops/sec
forEach #2 472298.4 Ops/sec
fromEntries and map #2 312137.5 Ops/sec
Object.assign and map #2 274443.8 Ops/sec
reduce #2 305774.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