In the example below, we will convert a string containing an int into the data type of number.
The parseInt() function accepts the string to convert and an optional radix.
In this tutorial, we will learn how to use it with int, float and hexadecimal strings. ParseInt() is a native JavaScript function that is used to convert strings into integers.