Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36
Chrome 124
Mac OS X 10.15.7
Desktop
7 months ago
Test name Executions per second
test 41749320.0 Ops/sec
match 30162902.0 Ops/sec
startsWith 167858768.0 Ops/sec
array 0 167836208.0 Ops/sec
includes 172428640.0 Ops/sec
search 35467656.0 Ops/sec
Tests:
  • test

    AخA
     
    /@.*/.test("@MyVariable")
  • match

     
    "@MyVariable".match(/@.*/)
  • startsWith

     
    "@MyVariable".startsWith("@")
  • array 0

     
    "@MyVariable"[0] === "@"
  • includes

     
    "@MyVariable".includes("@")
  • search

     
    "@MyVariable".search(/@.*/)