Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36
Chrome 103
Windows
Desktop
2 years ago
Test name Executions per second
if else if 188667.0 Ops/sec
if else 4844443.5 Ops/sec
if if 4670625.0 Ops/sec
switch case 31305.3 Ops/sec
indexOf 55078.1 Ops/sec
if != && 187155.1 Ops/sec
if == && 206021.1 Ops/sec
if != || 208072.8 Ops/sec
if || 187116.6 Ops/sec
if if if ... 183800.6 Ops/sec
Script Preparation code:
Tests:
  • if else if

  • if else

  • if if

  • switch case

  • indexOf

  • if != &&

  • if == &&

  • if != ||

  • if ||

  • if if if ...