Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36
Chrome 97
Linux
Desktop
2 years ago
Test name Executions per second
if else if 129141.8 Ops/sec
if else 4373300.0 Ops/sec
if if 4440292.5 Ops/sec
switch case 133506.0 Ops/sec
indexOf 133911.6 Ops/sec
if != && 120695.5 Ops/sec
if == && 123980.8 Ops/sec
if != || 129865.8 Ops/sec
if || 128492.0 Ops/sec
if if if ... 121091.8 Ops/sec
Script Preparation code:
Tests:
  • if else if

  • if else

  • if if

  • switch case

  • indexOf

  • if != &&

  • if == &&

  • if != ||

  • if ||

  • if if if ...