Run details:
Mozilla/5.0 (Linux;) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.106 Safari/537.36 SRAF/4.0 OB/v1.1
Chrome 47
Linux
Desktop
2 years ago
Test name Executions per second
if else if 11121.0 Ops/sec
if else 299264.1 Ops/sec
if if 306666.7 Ops/sec
switch case 11808.5 Ops/sec
indexOf 11206.7 Ops/sec
if != && 11461.4 Ops/sec
if == && 11921.4 Ops/sec
if != || 12163.7 Ops/sec
if || 11369.0 Ops/sec
if if if ... 11031.1 Ops/sec
Script Preparation code:
Tests:
  • if else if

  • if else

  • if if

  • switch case

  • indexOf

  • if != &&

  • if == &&

  • if != ||

  • if ||

  • if if if ...