1var string = "10";
2var double = parseFloat(string);
3console.log(typeof(double)); // float
4// parseFloat used for float and double datatypes
1// parseFloat takes in a string value and converts it to a float
2// The parseFloat function will look at the first character of
3// the string and decided whether that character is a number or not
4// If not the parseFloat function will return Nan
5
6let stringNumber = "8.0"
7
8let floatNuumber = parseFloat(stringNumber);