Run details:
Mozilla/5.0 (Linux; Android 11; M2007J20CI) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Mobile Safari/537.36
Chrome Mobile 104
Android
Mobile
2 years ago
Test name Executions per second
For Loop for item towards beginning 2735194.0 Ops/sec
While Loop for item towards beginning 2721124.2 Ops/sec
indexOf for item towards beginning 3020073.8 Ops/sec
For Loop for item towards end 2423814.2 Ops/sec
While Loop for item towards end 2384239.5 Ops/sec
indexOf for item towards end 2973633.0 Ops/sec
Script Preparation code:
Tests:
  • For Loop for item towards beginning

  • While Loop for item towards beginning

  • indexOf for item towards beginning

  • For Loop for item towards end

  • While Loop for item towards end

  • indexOf for item towards end