Always specify radix parameter for Javascript parseInt

This week I learned how important the radix parameter for the javascript parseInt is. I implemented my own custom date string parser and discovered that older versions of Firefox behaved differently when running the following line.

All the latest version browsers (IE, Chrome, Firefox, Safari) I tested on returned 8, but older versions of Firefox returned 0. My solution to this was to set the radix to 10.

Mozilla Developer Network’s Javascript parseInt page recommends always specifying the radix parameter to guarantee predictable behaviour.