Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.67 Safari/537.36 OPR/87.0.4390.45
Opera 87
Windows
Desktop
2 years ago
Test name Executions per second
if else if 204798.9 Ops/sec
if else 5150789.0 Ops/sec
if if 5226204.5 Ops/sec
switch case 216695.5 Ops/sec
indexOf 213278.6 Ops/sec
if != && 201633.7 Ops/sec
if == && 224350.4 Ops/sec
if != || 223188.7 Ops/sec
if || 206003.8 Ops/sec
if if if ... 199165.8 Ops/sec
Script Preparation code:
Tests:
  • if else if

  • if else

  • if if

  • switch case

  • indexOf

  • if != &&

  • if == &&

  • if != ||

  • if ||

  • if if if ...