Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.54 Safari/537.36
Chrome 95
Windows
Desktop
3 years ago
Test name Executions per second
if else if 267719.0 Ops/sec
if else 5686184.5 Ops/sec
if if 5645911.0 Ops/sec
switch case 288673.4 Ops/sec
indexOf 284051.2 Ops/sec
if != && 269072.7 Ops/sec
if == && 295411.1 Ops/sec
if != || 294663.0 Ops/sec
if || 276738.7 Ops/sec
if if if ... 258474.6 Ops/sec
Script Preparation code:
Tests:
  • if else if

  • if else

  • if if

  • switch case

  • indexOf

  • if != &&

  • if == &&

  • if != ||

  • if ||

  • if if if ...