parseInt Alternatives for parsing numerical strings
<p>Assuming I have a numerical string:</p>

<pre><code>var foo = "0";
</code></pre>

<p>Assume I want to parse it as a number, and increment it assigning the value to <code>bar</code> (just an arithmetical example), I know I could do:</p>

<pre><code>var bar = parseInt(foo, 10)+1;
</code></pre>

<p>But I believe the above example could be simpler and more readable. Consider this example:</p>

<pre><code>//alternative 1
var bar = +foo+1;
</code></pre>

<p>And this one:</p>

<pre><code>//alternative 2
var bar = ++foo;
</code></pre>

<p>Both of these will also yield the same result for <code>bar</code> (the latter will also increment <code>foo</code>, but that's no problem).</p>

<p>My question is, by using one of these alternatives, would I be exposing my code to the same possible implementation-dependant flaws of using <a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/parseInt" rel="nofollow"><code>parseInt</code></a> without specifying a <code>radix</code>/<code>base</code>?</p>

<p>Or are these safe to use as well?</p>

<p><a href="http://jsfiddle.net/ult_combo/q4q4v/" rel="nofollow"><strong>Fiddle for testing</strong></a>.</p>
