Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36 Edg/105.0.1343.42
Chrome 105
Windows
Desktop
2 years ago
Test name Executions per second
if else if 141317.7 Ops/sec
if else 4319110.0 Ops/sec
if if 3368001.5 Ops/sec
switch case 155537.8 Ops/sec
indexOf 144333.7 Ops/sec
if != && 117320.7 Ops/sec
if == && 146109.5 Ops/sec
if != || 159479.5 Ops/sec
if || 146063.8 Ops/sec
if if if ... 143936.5 Ops/sec
Script Preparation code:
Tests:
  • if else if

  • if else

  • if if

  • switch case

  • indexOf

  • if != &&

  • if == &&

  • if != ||

  • if ||

  • if if if ...


;