title: Proper usage of try/catch block in JavaScript
body: <p>I have a try/catch block that I have written into the JetBrains Webstorm IDE that is giving me an error.  The error reads as follows: "'throw' of exception caught locally / This inspection reports any instances of JavaScript <strong>throw</strong> statements whose exceptions are always caught by containing <strong>try</strong> statements.  Using <strong>throw</strong> statements as a 'goto' to change the local flow of control is likely to be confusing."</p>
  
  <pre><code>try {
      var invoice = parseInt(localStorage[0]);
      if (isNaN(invoice)) {
          console.warn("invoice NaN; let's fix that...");
          throw "executing catch";
      }
  }
  catch (e) {
      console.log(e);
      this.test();
      invoice = 1;
  }
  finally {
      localStorage[invoice] = JSON.stringify(Ticket);
      console.log("localStorage[" + invoice + '] : ' + localStorage[invoice]);
      localStorage[0] = parseInt(localStorage[0]) + 1;
  }
  </code></pre>
  
  <p>If I place the activity from the catch block into the if block of the try block, then i will have no need of try/catch/finally.  So how else would you throw an error other than with a conditional statement (if), and how can you avoid using throw as a "goto"?</p>
  
  <p>Thanks!</p>