title: Exit from if block in Javascript
body: <p>I want to exit from the below if block in Javascript. if I return, then it does not check for the next if condition. How do I do that?</p>
  
  <pre><code>if ($('#id1').length &gt; 0) {
  
      if(yester_energy == "NaN" || yester_energy == 0){
        //break from #id1
      }
  
      else{
        //something
      }
      $("#abc").html(somthing)
  }
  
  if ($('#id2').length &gt; 0) {
  
          if(yester_energy == "NaN" || yester_energy == 0){
            //break from #id2
          }
  
          else{
            //something
          }
  }
  </code></pre>