Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36
Chrome 107
Mac OS X 10.15.7
Desktop
2 years ago
Test name Executions per second
if else if 315711.8 Ops/sec
if else 8996429.0 Ops/sec
if if 9092428.0 Ops/sec
switch case 326191.3 Ops/sec
indexOf 324928.7 Ops/sec
if != && 308917.4 Ops/sec
if == && 324432.1 Ops/sec
if != || 327382.2 Ops/sec
if || 313905.1 Ops/sec
if if if ... 316389.9 Ops/sec
Script Preparation code:
Tests:
  • if else if

  • if else

  • if if

  • switch case

  • indexOf

  • if != &&

  • if == &&

  • if != ||

  • if ||

  • if if if ...