title: Check which condition in IF statement is true
body: <p>Is there any method in JavaScript to define which condition inside IF statement is fulfilled?</p>
  
  <p>For example:</p>
  
  <pre><code>if(a === 1 || b === 2) {
    // do something apart of fulfilled condition
    if(a === 1) {
      // do something
    } else if(b === 2) {
      // do something else
    }
  } 
  </code></pre>
  
  <p>Code above working as expected but I'm wondering if there is a clever way to do this easier, especially when there will be more conditions.</p>
  
  <p>Thanks for answers. </p>