Demo integer input and parseInt with radix

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:

0218 = 2*81 + 1*80 = 16 + 1 = 1710

Right-click and choose View, Source to see the radix parameter in use.

Enter age: