title: Best way to "Exit" in javascript
body: <p>My goal is to:</p>
  
  <pre><code>if(error){
      window.location.href = "error.htm";
      //end of every thing
  }
  </code></pre>
  
  <p>What's more, <code>return false</code> wouldnt help because there may be functions inside of functions.
  My current solution is <code>throw</code>, but i feel uncomfortable</p>
  
  <p>Any better idea || solution ??</p>