title: Which is better If-Else-If chain or multiple If
body: <p>Say I have a random number.</p>
  
  <p>Which is more efficient:</p>
  
  <pre><code>if (num == 1) {
  
  } else if (num ==2) {
  
  } else if (num == 3) {
  
  } else if (num == 4) {
  
  } else if (num == 5) {
  
  } else {};
  </code></pre>
  
  <p>or</p>
  
  <pre><code>if (num == 1) {};
  if (num == 2) {};
  if (num == 3) {};
  if (num == 4) {};
  if (num == 5) {};
  </code></pre>
  
  <p>is there much of a different performance-wise?</p>
  
  <p>Or should I do a switch chain?</p>