- The parseint () method first looks at the character at position 0, determines if it is a valid number, and if not, the method returns Nan, and no further action is taken. However, if the character is a valid number, the method will look at the character at position 1 and perform the same test. This process continues until a character is found that is not a valid number, at which point the parseint () converts the string before the character to a number.
- parsefloat () method view each character starting at position 0 until the first non-valid character is found, and then convert the string before the character to a number.
However, for this method, the first decimal point that appears is a valid character. If there are two decimal points, the second decimal point will be considered invalid,
Usage of Javascript parseint () and parsefloat ()