Run details:
Mozilla/5.0 (Linux; Android 10; M2006C3MG) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.101 Mobile Safari/537.36
Chrome Mobile 87
Android
Mobile
one year ago
Test name Executions per second
.forEach 0.8 Ops/sec
for..of 1.0 Ops/sec
for..of (destructuring) 0.4 Ops/sec
.map 0.4 Ops/sec
.map (destructuring) 0.5 Ops/sec
.for (init array) 0.6 Ops/sec
.reduce 0.6 Ops/sec
.reduce (destructuring) 0.7 Ops/sec
for..of (reduce) 0.7 Ops/sec
for..of (reduce) (destructuring) 0.4 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)