Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.41 Safari/537.36
Chrome 101
Windows
Desktop
2 years ago
Test name Executions per second
if else if 97923.4 Ops/sec
if else 4289523.0 Ops/sec
if if 4373324.5 Ops/sec
switch case 119720.7 Ops/sec
indexOf 114872.5 Ops/sec
if != && 98128.1 Ops/sec
if == && 112276.8 Ops/sec
if != || 119094.8 Ops/sec
if || 103374.7 Ops/sec
if if if ... 103894.2 Ops/sec
Script Preparation code:
Tests:
  • if else if

  • if else

  • if if

  • switch case

  • indexOf

  • if != &&

  • if == &&

  • if != ||

  • if ||

  • if if if ...