title: + operator vs parseFloat
body: <p><a href="http://knockoutjs.com/documentation/extenders.html" rel="nofollow noreferrer">Example 1</a> of the knockout extenders page describes a way of rounding user input and making sure it is only numeric.</p>
  
  <p>It works great, but looking through the source they do a peculiar thing that i don't understand, that is on line 8 they do this:</p>
  
  <pre><code>parseFloat(+newValue)
  </code></pre>
  
  <p><code>newValue</code> is a string.</p>
  
  <p>When i initially asked this question I didn't know what <code>+</code> did - some further <a href="https://stackoverflow.com/questions/12227594/which-is-better-numberx-or-parsefloatx">poking</a> and a <a href="https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Operators/Arithmetic_Operators#Unary_plus_()" rel="nofollow noreferrer">link to a different MDN page</a> from one of the initial answers I got indicate it is a unary operator equivalent to <code>number(str)</code> and that there are some differences between <code>+str</code> and <code>parseFloat(str)</code> (treatment of strings ending in alpha characters and interpretation of hex seem to be the headlines).</p>
  
  <p>I still don't understand why the <code>+</code> in this case needed to be wrapped in the <code>parseFloat</code> although I am starting to think it might be a typo...</p>