When I do this:
parseInt(39,16)
I get this:
57
What does the second argument means?
I read this:
radix Optional. A number (from 2 to 36) that represents the numeral system to be used
But what do I get with the number 16?
The second argument is the number system you're using - in your case "39" is hexadecimal, because you passed "16" as a second argument.
Please refer to the documentation.
So if you want to get decimal number, use:
parseInt(39, 10);
For example, a radix of 10 indicates to convert from a decimal number, 8 octal, 16 hexadecimal, and so on. For radices above 10, the letters of the alphabet indicate numerals greater than 9. For example, for hexadecimal numbers (base 16), A through F are used.
+=>+'39' = 39