Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36
Chrome 106
Windows
Desktop
2 years ago
Test name Executions per second
if else if 202427.8 Ops/sec
if else 3996267.5 Ops/sec
if if 4215144.5 Ops/sec
switch case 132655.2 Ops/sec
indexOf 134678.3 Ops/sec
if != && 129418.5 Ops/sec
if == && 130318.2 Ops/sec
if != || 138042.4 Ops/sec
if || 134040.1 Ops/sec
if if if ... 111606.6 Ops/sec
Script Preparation code:
Tests:
  • if else if

  • if else

  • if if

  • switch case

  • indexOf

  • if != &&

  • if == &&

  • if != ||

  • if ||

  • if if if ...