Today when I was looking at jquery, parseFloat (the first parameter, 10) was used. I never understood what the second parameter meant, so I checked it online and wrote it down in case I forgot it later.
Definition and usage: The parseFloat() function parses a string and returns a floating point number.
Syntax: parseFloat(string), the parameter string is required and represents the string to be parsed
Return value: Returns the parsed number
Notes:
1. Leading and trailing spaces are allowed.
2. If the first character of the string cannot be converted to a number, then parseFloat() will return NaN
3. If you only want to parse the integer part of the number, use the parseInt() method.
4. Only the first number in the string will be returned.
Attached example: