Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36
Chrome 103
Mac OS X 10.15.7
Desktop
2 years ago
Test name Executions per second
if else if 333682.8 Ops/sec
if else 8117207.0 Ops/sec
if if 8675230.0 Ops/sec
switch case 374372.3 Ops/sec
indexOf 339547.0 Ops/sec
if != && 337699.1 Ops/sec
if == && 361499.6 Ops/sec
if != || 376626.2 Ops/sec
if || 348781.8 Ops/sec
if if if ... 351208.7 Ops/sec
Script Preparation code:
Tests:
  • if else if

  • if else

  • if if

  • switch case

  • indexOf

  • if != &&

  • if == &&

  • if != ||

  • if ||

  • if if if ...


;