JavaScript parseInt()
JavaScript parseInt()
The parseInt() global method is used to parse a value as a string and returns the first integer. It has a parameter radix which is optional and which is used to specify the number system to use i.e, 2, 8, 16, or any other. By default, the system used is 10.
Syntax:-
Its syntax is:- parseInt(string, radix)
Return:-
Its return is:- number and NaN if no integer is found
Further Explanation:-
Parameter | Description |
value | Required. The value to be parsed. |
radix | Optional.A number between 2 and 36 which specify the number system. By default is 10. |