For JavaScript a number starting with 0 is considered to be octal, a number starting with 0x is considered to be hexadecimal, and all other numbers are considered to be decimal. In octal, the digits range from 0 to 7, and thus parseInt(‘08′) will return 0 because the 8 is an illegal digit.
To fix it you can override the JavaScript automatic radix detection by providing a second argument to the parseInt function, having a value of 10 which is for decimal numbers. Thus, you do it like this:
var MyNumber=parseInt(‘08′, 10);
That code will return 8 as you want.