Run details:
Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Mobile Safari/537.36
Chrome Mobile 114
Android
Mobile
one year ago
Test name Executions per second
For Loop for item towards beginning 4540590.5 Ops/sec
While Loop for item towards beginning 4561167.0 Ops/sec
indexOf for item towards beginning 4655178.0 Ops/sec
For Loop for item towards end 3449093.8 Ops/sec
While Loop for item towards end 3433442.5 Ops/sec
indexOf for item towards end 4582786.5 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