Run details:
Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/125.0.6422.80 Mobile/15E148 Safari/604.1
Chrome Mobile iOS 125
iOS 17.5
Mobile
6 months ago
Test name Executions per second
Using indexOf 181.4 Ops/sec
Using lastIndexOf 174.2 Ops/sec
Using a Set 968.7 Ops/sec
Script Preparation code:
Tests:
  • Using indexOf

  • Using lastIndexOf

  • Using a Set