Run details:
Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:109.0) Gecko/20100101 Firefox/110.0
Firefox 110
Windows 7
Desktop
one year ago
Test name Executions per second
For Loop for item towards beginning 47326264.0 Ops/sec
While Loop for item towards beginning 47975188.0 Ops/sec
indexOf for item towards beginning 14493693.0 Ops/sec
For Loop for item towards end 5785525.0 Ops/sec
While Loop for item towards end 5754701.0 Ops/sec
indexOf for item towards end 7799656.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