Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:131.0) Gecko/20100101 Firefox/131.0
Firefox 131
Windows
Desktop
2 months ago
Test name Executions per second
For Loop for item towards beginning 66324044.0 Ops/sec
While Loop for item towards beginning 65162104.0 Ops/sec
indexOf for item towards beginning 27910094.0 Ops/sec
For Loop for item towards end 11491574.0 Ops/sec
While Loop for item towards end 11409224.0 Ops/sec
indexOf for item towards end 12321217.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