Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36
Chrome 100
Windows
Desktop
2 years ago
Test name Executions per second
if else if 182542.7 Ops/sec
if else 3999909.8 Ops/sec
if if 3992104.0 Ops/sec
switch case 197007.1 Ops/sec
indexOf 189731.1 Ops/sec
if != && 177779.8 Ops/sec
if == && 198726.8 Ops/sec
if != || 197344.7 Ops/sec
if || 183451.7 Ops/sec
if if if ... 179276.6 Ops/sec
Script Preparation code:
Tests:
  • if else if

  • if else

  • if if

  • switch case

  • indexOf

  • if != &&

  • if == &&

  • if != ||

  • if ||

  • if if if ...