Run details:
Mozilla/5.0 (Linux; Android 13; M2012K11AG) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Mobile Safari/537.36
Chrome Mobile 104
Android
Mobile
10 months ago
Test name Executions per second
.forEach 3.3 Ops/sec
for..of 4.2 Ops/sec
for..of (destructuring) 4.1 Ops/sec
.map 3.2 Ops/sec
.map (destructuring) 3.4 Ops/sec
.for (init array) 3.7 Ops/sec
.reduce 4.0 Ops/sec
.reduce (destructuring) 3.7 Ops/sec
for..of (reduce) 4.1 Ops/sec
for..of (reduce) (destructuring) 4.0 Ops/sec
Script Preparation code:
Tests:
  • .forEach

  • for..of

  • for..of (destructuring)

  • .map

  • .map (destructuring)

  • .for (init array)

  • .reduce

  • .reduce (destructuring)

  • for..of (reduce)

  • for..of (reduce) (destructuring)