Just to be safe, use:
parseInt('42', 10);
which converts to decimal. If you use any number starting with a '0', then parseInt will see that as as octal number.
By default,
parseInt('042');
equals 34 in decimal.
Another way to convert a string to numeric value is to just multiply by 1.