Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.93 Safari/537.36
Chrome 96
Windows
Desktop
3 years ago
Test name Executions per second
if else if 59868.0 Ops/sec
if else 1856236.9 Ops/sec
if if 1820408.4 Ops/sec
switch case 61236.8 Ops/sec
indexOf 60740.2 Ops/sec
if != && 58429.6 Ops/sec
if == && 61967.2 Ops/sec
if != || 61793.4 Ops/sec
if || 58644.6 Ops/sec
if if if ... 58517.8 Ops/sec
Script Preparation code:
Tests:
  • if else if

  • if else

  • if if

  • switch case

  • indexOf

  • if != &&

  • if == &&

  • if != ||

  • if ||

  • if if if ...