Provide a second argument 10 which specifies the radix - a base 10 number. If you do not pass this and first argument starts with 0 than it would be considered as octal.  Same of other usage of parseInt