Run details:
Mozilla/5.0 (iPhone; CPU iPhone OS 16_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/110.0.5481.114 Mobile/15E148 Safari/604.1
Chrome Mobile iOS 110
iOS 16.3
Mobile
one year ago
Test name Executions per second
Using indexOf 261.8 Ops/sec
Using lastIndexOf 207.5 Ops/sec
Using a Set 1263.4 Ops/sec
Script Preparation code:
Tests:
  • Using indexOf

  • Using lastIndexOf

  • Using a Set