Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.84 Safari/537.36
Chrome 99
Windows
Desktop
2 years ago
Test name Executions per second
if else if 246164.6 Ops/sec
if else 5586978.5 Ops/sec
if if 5600017.5 Ops/sec
switch case 271215.8 Ops/sec
indexOf 270216.8 Ops/sec
if != && 247772.9 Ops/sec
if == && 279789.8 Ops/sec
if != || 272279.6 Ops/sec
if || 249361.3 Ops/sec
if if if ... 243786.5 Ops/sec
Script Preparation code:
Tests:
  • if else if

  • if else

  • if if

  • switch case

  • indexOf

  • if != &&

  • if == &&

  • if != ||

  • if ||

  • if if if ...