Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36
Chrome 94
Windows
Desktop
3 years ago
Test name Executions per second
if else if 223938.0 Ops/sec
if else 4659363.5 Ops/sec
if if 4739147.5 Ops/sec
switch case 224678.5 Ops/sec
indexOf 200338.4 Ops/sec
if != && 190981.6 Ops/sec
if == && 191757.3 Ops/sec
if != || 216118.4 Ops/sec
if || 169906.4 Ops/sec
if if if ... 190349.7 Ops/sec
Script Preparation code:
Tests:
  • if else if

  • if else

  • if if

  • switch case

  • indexOf

  • if != &&

  • if == &&

  • if != ||

  • if ||

  • if if if ...