Run details:
Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Mobile Safari/537.36
Chrome Mobile 121
Android
Mobile
10 months ago
Test name Executions per second
For Loop for item towards beginning 6125335.5 Ops/sec
While Loop for item towards beginning 6119141.5 Ops/sec
indexOf for item towards beginning 6331075.5 Ops/sec
For Loop for item towards end 5259515.0 Ops/sec
While Loop for item towards end 5254877.5 Ops/sec
indexOf for item towards end 6338139.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