title: Do I need a last `else` clause in an `if...else if` statement?
body: <p>Every <code>if...else if</code> example I’ve seen includes a final <code>else</code> clause:</p>
  
  <pre><code>if (condition1) {
    doA();
  } else if (condition2) {
    doB();
  } else if (condition3) {
    doC();
  } else {
    noConditionsMet();
  }
  alwaysDoThis();
  </code></pre>
  
  <p>I understand that this is basically syntactic sugar for nested <code>if...else</code> statements:</p>
  
  <pre><code>if (condition1) {
    doA();
  } else {
    if (condition2) {
      doB();
    } else {
      if (condition3) {
        doC();
      } else {
        noConditionsMet();
      }
    }
  }
  alwaysDoThis();
  </code></pre>
  
  <p>I have never seen any examples of an <code>if...else if</code> that <strong>omits the last <code>else</code> clause</strong>. But seeing as plain <code>if</code> statements (without <code>else</code> clauses) are valid, and going by the equivalent “nested statements” above, my gut tells me that this is okay to do:</p>
  
  <pre><code>if (condition1) {
    doA();
  } else if (condition2) {
    doB();
  } else if (condition3) {
    doC();
  }
  alwaysDoThis();
  </code></pre>
  
  <p>Can someone point me to a resource or example that explicitly says whether or not it’s valid?</p>
  
  <p>And on another level, if it <em>is</em> valid, would it be recommended or is it considered “bad practice”?</p>