Run details:
Mozilla/5.0 (Android 14; Mobile; rv:131.0) Gecko/131.0 Firefox/131.0
Firefox Mobile 131
Android
Mobile
2 months ago
Test name Executions per second
For Loop for item towards beginning 108451768.0 Ops/sec
While Loop for item towards beginning 106385936.0 Ops/sec
indexOf for item towards beginning 27949540.0 Ops/sec
For Loop for item towards end 15778226.0 Ops/sec
While Loop for item towards end 17068624.0 Ops/sec
indexOf for item towards end 15317854.0 Ops/sec
includes for item towards start 24302244.0 Ops/sec
includes for item towards end 14102850.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

  • includes for item towards start

  • includes for item towards end