parseFloat
function will convert string to floating point number. parseFloat start parsing the string from first characters till it find all number as number. for example: parseFloat("10") - 10 parseFloat("10.33") - 10.33 parseFloat("34 45 66") - 34 parseFloat(" 60 ") - 60 parseFloat("40 years") - 40 parseFloat("I am 40") -NAN parseFloat("44 am 40") - 44