title: Getting line in jQuery code where function is handled
body: <p>I'm working on the error handling for a jQuery practise project and I was wondering if it is possible to get the line were the error occured. For example:</p>
  
  <pre><code>function number(x) {
      if (x === 1) {
          alert("ok");
      } else {
          alert("Invalid number was given on line ...")
      }
  }
  
  number(2);​
  </code></pre>
  
  <p>Now I would like to alert instead of the ... the line the error occured in. Thanks in advance.</p>