Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.80 Safari/537.36
Chrome 75
Windows
Desktop
5 years ago
Test name Executions per second
if else if 146394.5 Ops/sec
if else 4143426.0 Ops/sec
if if 4189234.2 Ops/sec
switch case 154369.1 Ops/sec
indexOf 151317.5 Ops/sec
if != && 145826.1 Ops/sec
if == && 11471248.0 Ops/sec
if != || 156577.5 Ops/sec
if || 145117.8 Ops/sec
Script Preparation code:
Tests:
  • if else if

  • if else

  • if if

  • switch case

  • indexOf

  • if != &&

  • if == &&

  • if != ||

  • if ||

  • if if if ...