Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.61 Safari/537.36
Chrome 94
Linux
Desktop
3 years ago
Test name Executions per second
if else if 66611.0 Ops/sec
if else 2121940.2 Ops/sec
if if 2199933.0 Ops/sec
switch case 72386.1 Ops/sec
indexOf 61023.7 Ops/sec
if != && 61784.7 Ops/sec
if == && 65114.4 Ops/sec
if != || 66250.8 Ops/sec
if || 64320.6 Ops/sec
if if if ... 62119.0 Ops/sec
Script Preparation code:
Tests:
  • if else if

  • if else

  • if if

  • switch case

  • indexOf

  • if != &&

  • if == &&

  • if != ||

  • if ||

  • if if if ...