parseInt() Function Returning Zero For Numbers ’08’ and ’09’
var myNumber = parseInt('08');
If the string begins with "0", the radix is 8 (octal).
Sound familiar? Good. So to get the function working as expected we need to work in base 10. To do this we simply pass the base as an additional parameter to parseInt() like so:
var myNumber = parseInt('08', 10);
What you’ll now get returned is the expected ‘8’.