Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36
Chrome 102
Linux
Desktop
2 years ago
Test name Executions per second
if else if 174342.6 Ops/sec
if else 5907726.0 Ops/sec
if if 5086224.5 Ops/sec
switch case 178187.9 Ops/sec
indexOf 185688.8 Ops/sec
if != && 181554.3 Ops/sec
if == && 182964.8 Ops/sec
if != || 134648.3 Ops/sec
if || 158639.4 Ops/sec
if if if ... 123086.7 Ops/sec
Script Preparation code:
Tests:
  • if else if

  • if else

  • if if

  • switch case

  • indexOf

  • if != &&

  • if == &&

  • if != ||

  • if ||

  • if if if ...