type casting float js 1

type casting float js

parseFloat()

Here is what the above code is Doing:
1. We’re creating a variable called “my_string” and setting it equal to “123.456”.
2. We’re creating a variable called “my_float” and setting it equal to the result of calling the parseFloat() function on “my_string”.
3. We’re printing out the value of “my_float”.

Similar Posts