Javascript parseInt() with leading zeros
<p>Javascript's parseInt function does not seem to completely work.</p>

<pre><code>parseInt("01") returns 1
parseInt("02") returns 2
parseInt("03") returns 3
parseInt("04") returns 4
parseInt("05") returns 5
parseInt("06") returns 6
parseInt("07") returns 7
parseInt("08") returns 0
parseInt("09") returns 0
</code></pre>

<p>You can't explain that.</p>

<p>Give it a try: <a href="http://www.w3schools.com/jsref/tryit.asp" rel="nofollow">http://www.w3schools.com/jsref/tryit.asp</a></p>

<pre><code>&lt;html&gt;
&lt;body&gt;
&lt;script type="text/javascript"&gt;
document.write(parseInt("01") + "&lt;br /&gt;") ;
document.write(parseInt("02") + "&lt;br /&gt;") ;
document.write(parseInt("03") + "&lt;br /&gt;") ;
document.write(parseInt("04") + "&lt;br /&gt;") ;
document.write(parseInt("05") + "&lt;br /&gt;") ;
document.write(parseInt("06") + "&lt;br /&gt;") ;
document.write(parseInt("07") + "&lt;br /&gt;") ;
document.write(parseInt("08") + "&lt;br /&gt;") ;
document.write(parseInt("09") + "&lt;br /&gt;") ;
&lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>Edit, Ah, thanks for the quick answers. That explains it!</p>
