Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36
Chrome 106
Windows
Desktop
2 years ago
Test name Executions per second
if else if 186277.1 Ops/sec
if else 3949040.8 Ops/sec
if if 3762731.0 Ops/sec
switch case 193227.6 Ops/sec
indexOf 192093.7 Ops/sec
if != && 173658.4 Ops/sec
if == && 208745.2 Ops/sec
if != || 208586.6 Ops/sec
if || 187124.9 Ops/sec
if if if ... 189476.7 Ops/sec
Script Preparation code:
Tests:
  • if else if

  • if else

  • if if

  • switch case

  • indexOf

  • if != &&

  • if == &&

  • if != ||

  • if ||

  • if if if ...