Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36
Chrome 96
Windows
Desktop
3 years ago
Test name Executions per second
if else if 159849.4 Ops/sec
if else 3768849.2 Ops/sec
if if 3801924.0 Ops/sec
switch case 172218.3 Ops/sec
indexOf 166454.7 Ops/sec
if != && 155179.9 Ops/sec
if == && 171244.5 Ops/sec
if != || 172370.6 Ops/sec
if || 158105.3 Ops/sec
if if if ... 150783.9 Ops/sec
Script Preparation code:
Tests:
  • if else if

  • if else

  • if if

  • switch case

  • indexOf

  • if != &&

  • if == &&

  • if != ||

  • if ||

  • if if if ...