Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4875.0 Safari/537.36
Chrome 100
Mac OS X 10.15.7
Desktop
2 years ago
Test name Executions per second
if else if 170293.3 Ops/sec
if else 5157874.5 Ops/sec
if if 5115394.0 Ops/sec
switch case 178302.4 Ops/sec
indexOf 177371.0 Ops/sec
if != && 162448.8 Ops/sec
if == && 176494.0 Ops/sec
if != || 195227.4 Ops/sec
if || 173798.2 Ops/sec
if if if ... 173570.5 Ops/sec
Script Preparation code:
Tests:
  • if else if

  • if else

  • if if

  • switch case

  • indexOf

  • if != &&

  • if == &&

  • if != ||

  • if ||

  • if if if ...