Alex Le’s Blog � Blog Archive � “safer” parseInt() for JavaScript with plus unary operator:

Additionally, parseInt and make different assumptions about the radix when there’s a leading zero. ”012″ returns 12, but parseInt(”012″) returns 10. The leading zero causes parseInt to treat it as an octal number in probably all browsers, despite octals being summarily deprecated in ES3. Of course, you can use parseInt(”012″,10) to get around that.

Ran into this while looking for info on using the "unary plus".  See?  This is another reason why Crockford's not full of it, for those who still think he is.  Missing radix !== jslinted.

Labels: ,