Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36
Chrome 100
Windows
Desktop
2 years ago
Test name Executions per second
if else if 135659.5 Ops/sec
if else 3726894.8 Ops/sec
if if 3774022.0 Ops/sec
switch case 145639.4 Ops/sec
indexOf 145385.0 Ops/sec
if != && 113806.0 Ops/sec
if == && 115985.1 Ops/sec
if != || 116299.1 Ops/sec
if || 104519.7 Ops/sec
if if if ... 86947.2 Ops/sec
Script Preparation code:
Tests:
  • if else if

  • if else

  • if if

  • switch case

  • indexOf

  • if != &&

  • if == &&

  • if != ||

  • if ||

  • if if if ...