|
The parseInt method treats a number with leading zeroes as octal, or base 8! To see why the radix option on the parseInt is important, enter an age of "021". It will be interpreted as 17 rather than 21! Here's why:
Right-click and choose View, Source to see the radix parameter in use. |