Run details:
Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko
IE 11
Windows 7
Desktop
one year ago
Test name Executions per second
For Loop for item towards beginning 6918604.5 Ops/sec
While Loop for item towards beginning 7056268.5 Ops/sec
indexOf for item towards beginning 3671819.5 Ops/sec
For Loop for item towards end 3750063.5 Ops/sec
While Loop for item towards end 3758597.5 Ops/sec
indexOf for item towards end 1220600.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