Run details:
Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/94.0.4606.52 Mobile/15E148 Safari/604.1
Chrome Mobile iOS 94
iOS 15.0
Mobile
3 years ago
Test name Executions per second
if else if 1138916.0 Ops/sec
if else 6502652.5 Ops/sec
if if 6448868.5 Ops/sec
switch case 998538.4 Ops/sec
indexOf 643760.1 Ops/sec
if != && 580590.6 Ops/sec
if == && 1048512.6 Ops/sec
if != || 745215.6 Ops/sec
if || 1169437.8 Ops/sec
if if if ... 1116472.5 Ops/sec
Script Preparation code:
Tests:
  • if else if

  • if else

  • if if

  • switch case

  • indexOf

  • if != &&

  • if == &&

  • if != ||

  • if ||

  • if if if ...