HTML Preparation code:
Script Preparation code:
Tests:
  • Use hasClass shorthand

  • Use classList

Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results
  • Test case name Result
    Use hasClass shorthand
    Use classList

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 3 years ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36
Chrome 89 on Mac OS X 10.13.6
View result in a separate tab
Test name Executions per second
Use hasClass shorthand 2228159.8 Ops/sec
Use classList 5433962.5 Ops/sec