Run details:
Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:72.0) Gecko/20100101 Firefox/72.0
Firefox 72
Windows 7
Desktop
one year ago
Test name Executions per second
For Loop for item towards beginning 56314268.0 Ops/sec
While Loop for item towards beginning 56726240.0 Ops/sec
indexOf for item towards beginning 54971192.0 Ops/sec
For Loop for item towards end 15252913.0 Ops/sec
While Loop for item towards end 14882366.0 Ops/sec
indexOf for item towards end 14763795.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


;