Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.54 Safari/537.36
Chrome 101
Windows
Desktop
2 years ago
Test name Executions per second
if else if 29579.0 Ops/sec
if else 1422517.5 Ops/sec
if if 1510886.6 Ops/sec
switch case 32254.8 Ops/sec
indexOf 39069.5 Ops/sec
if != && 34518.3 Ops/sec
if == && 37479.6 Ops/sec
if != || 38359.0 Ops/sec
if || 38279.7 Ops/sec
if if if ... 36573.3 Ops/sec
Script Preparation code:
Tests:
  • if else if

  • if else

  • if if

  • switch case

  • indexOf

  • if != &&

  • if == &&

  • if != ||

  • if ||

  • if if if ...