Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36 Edg/112.0.1722.39
Chrome 112
Mac OS X 10.15.7
Desktop
one year ago
Test name Executions per second
Array.forEach (native) 1841.7 Ops/sec
lodash _.each 1789.3 Ops/sec
Array.map (native, discarding result) 1187.7 Ops/sec
lodash _.map (discarding result) 2900.5 Ops/sec
for loop (x of arr) 12305.5 Ops/sec
for loop (indexed) 115.8 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • Array.forEach (native)

  • lodash _.each

  • Array.map (native, discarding result)

  • lodash _.map (discarding result)

  • for loop (x of arr)

  • for loop (indexed)


;