Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36
Chrome 92
Mac OS X 10.15.7
Desktop
3 years ago
Test name Executions per second
if else if 71340.0 Ops/sec
if else 4919134.5 Ops/sec
if if 4774015.5 Ops/sec
switch case 73737.4 Ops/sec
indexOf 72245.2 Ops/sec
if != && 70222.6 Ops/sec
if == && 79627.0 Ops/sec
if != || 73386.5 Ops/sec
if || 70187.1 Ops/sec
if if if ... 68283.3 Ops/sec
Script Preparation code:
Tests:
  • if else if

  • if else

  • if if

  • switch case

  • indexOf

  • if != &&

  • if == &&

  • if != ||

  • if ||

  • if if if ...