December 12, 2012
var string2Number = "08"; parseInt(string2Number)
This works for just about everything…. except “08” and “09”.
So, since they aren’t octal you need to provide a base parameter. This is just good practice regardless, so make a habit of doing this and you’ll never run into this problem.