title: JavaScript if else condition confusion
body: <p>I have below code</p>
  <pre><code>if (gridObj.INVOICEORDERNUMBER) {
    if (!cancelledStatus.length &amp;&amp; !withDrawn.length) {
      this.gridCmp.editValidation = true;
      this.errorMessage = ErrorMessage.OpenOrderMsg;
    } else {
      this.relatedLicenses = false;
      this.hasDRLPLicense = false;
      this.deletePopupMsg = ErrorMessage.DeletePopupMsg;
      this.showDeletePopup = true;
    }
  } else if (this.hasDRLPLicense) {
    this.gridCmp.editValidation = true;
    this.errorMessage2 = ErrorMessage.DRLPLicenseDeleteMsg;
  } else {
    this.relatedLicenses = false;
    this.hasDRLPLicense = false;
    this.deletePopupMsg = ErrorMessage.DeletePopupMsg;
    this.showDeletePopup = true;
  }
  </code></pre>
  <p>Here I need to check whether both <code>if</code> conditions satisfy or not. With the current approach, I can only check anyone if condition, as it is an <code>if-else</code>, <code>if</code> statement.</p>
  <p>What I need to achieve here is</p>
  <ol>
  <li>If first <code>if</code> condition is satisfied -&gt; <code>show errorMessage</code></li>
  <li>If second <code>if</code> condition (else if) satisfied -&gt; <code>show errorMessage2</code></li>
  <li>If both satisfied -&gt; <code>show both errorMessage and errorMessage2</code></li>
  <li>If none satisfied -&gt; <code>execute else</code></li>
  </ol>
  <p>This might be a stupid question, but my brain is not working any more today. Please help. Thanks</p>