The parseInt() function is used to convert numbers between different bases. parseInt() takes the string to be converted as its first parameter. The second parameter is the base of the given string.
To convert 4F (or base 16) to integer, the code used will be –
parseInt ("4F", 16);