title: JsPerf: ParseInt vs Plus conversion
body: <p>I've try to probe that plus (+) conversion is faster than parseInt with the following jsperf, and the results surprised me:</p>
  
  <p><strong><a href="http://jsperf.com/parse-vs-plus" rel="noreferrer">Parse vs Plus</a></strong></p>
  
  <p><strong>Preparation code</strong></p>
  
  <pre><code>&lt;script&gt;
    Benchmark.prototype.setup = function() {
      var x = "5555";
    };
  &lt;/script&gt;
  </code></pre>
  
  <p>Parse Sample</p>
  
  <pre><code>var y = parseInt(x); //&lt;---80 million loops
  </code></pre>
  
  <p>Plus Sample</p>
  
  <pre><code>var y = +x; //&lt;--- 33 million loops
  </code></pre>
  
  <p>The reason is because I'm using "Benchmark.prototype.setup" in order to declare my variable, but I don't understand why</p>
  
  <p>See the second example:</p>
  
  <p><strong><a href="http://jsperf.com/parse-vs-plus/2" rel="noreferrer">Parse vs Plus (local variable)</a></strong></p>
  
  <pre><code>&lt;script&gt;
    Benchmark.prototype.setup = function() {
      x = "5555";
    };
  &lt;/script&gt;
  </code></pre>
  
  <p>Parse Sample</p>
  
  <pre><code>var y = parseInt(x); //&lt;---89 million loops
  </code></pre>
  
  <p>Plus Sample</p>
  
  <pre><code>var y = +x; //&lt;--- 633 million loops
  </code></pre>
  
  <p>Can someone explain the results?</p>
  
  <p>Thanks</p>