title: How to determine which if statement the else belongs to?
body: <p>I wrote the following code and confused myself.</p>
  
  <pre><code>if(condition1)
      if(condition2){
          doStuff()
      }
  else {
      doOtherStuff();
  }
  </code></pre>
  
  <p>When it's indented like this it looks like the else belongs to the condition1 if. But if we change some whitespace, it looks like it's part of the condition2 if like so:</p>
  
  <pre><code>if(condition1)
      if(condition2){
          doStuff()
      } else {
          doOtherStuff();
      }
  </code></pre>
  
  <p>So which does it belong to? I put in brackets for the condition1 as to be more clear, but which of these is correct?</p>