Description
Converts strings into integers.
Syntax
parseInt(string, [radix])
Parameters
Returns
The parseInt method returns an integer value equal to the number contained in string. If no prefix of string can be successfully parsed into an integer, NaN (not a number) is returned.
Examples
parseInt("abc") // Returns NaN.
parseInt("12abc") // Returns 12.
//You can test for NaN by using the isNaN method.