title: Evaluating a string as a mathematical expression in JavaScript
body: <p>How do I parse and evaluate a mathematical expression in a string (e.g. <code>'1+1'</code>) without invoking <code>eval(string)</code> to yield its numerical value?</p>
  
  <p>With that example, I want the function to accept <code>'1+1'</code> and return <code>2</code>.</p>