Run details:
Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Mobile Safari/537.36
Chrome Mobile 120
Android
Mobile
11 months ago
Test name Executions per second
Classic for loop 10538.4 Ops/sec
Optimised classic for loop 20847.8 Ops/sec
While loop 10581.9 Ops/sec
Optimised while loop 20899.7 Ops/sec
Array.prototype.forEach 322102.2 Ops/sec
Array.prototype.reduce 2461081.0 Ops/sec
For - of loop 414407.0 Ops/sec
For - in loop 15364.1 Ops/sec
Script Preparation code:
Tests:
  • Classic for loop

  • Optimised classic for loop

  • While loop

  • Optimised while loop

  • Array.prototype.forEach

  • Array.prototype.reduce

  • For - of loop

  • For - in loop


;