Run details:
Mozilla/5.0 (Linux; Android 11) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Mobile Safari/537.36
Chrome Mobile 113
Android
Mobile
one year ago
Test name Executions per second
reduce with new array 5.0 Ops/sec
reduce with array mutation 14907.5 Ops/sec
flatMap 221.9 Ops/sec
for 487.2 Ops/sec
for-of 15496.8 Ops/sec
map 24014.5 Ops/sec
forEach 12462.3 Ops/sec
values (iterates over for-of) 15799.5 Ops/sec
Script Preparation code:
Tests:
  • reduce with new array

  • reduce with array mutation

  • flatMap

  • for

  • for-of

  • map

  • forEach

  • values (iterates over for-of)