Run details:
Mozilla/5.0 (iPad; CPU OS 14_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1.1 Mobile/15E148 Safari/604.1
Mobile Safari 14
iOS 14.6
Tablet
3 years ago
Test name Executions per second
if/if 1280524.6 Ops/sec
if/or 1279043.4 Ops/sec
if/or double equal 1273506.1 Ops/sec
Script Preparation code:
AخA
 
var test = 'test5'
Tests:
  • if/if

     
    if (test === 'test1') {
      return true;
    }
    if (test === 'test2') {
      return true;
    }
    if (test === 'test3') {
      return true;
    }
    if (test === 'test4') {
      return true;
    }
    if (test === 'test5') {
      return true;
    }
  • if/or

    x
     
    if (test === 'test1' || test === 'test2' || test === 'test3' || test === 'test4'|| test === 'test5') return true;
  • if/or double equal

     
    if (test == 'test1' || test == 'test2' || test == 'test3' || test == 'test4'|| test == 'test5') return true;