parseFloat for these type of conversions.
For example, you would do something like this for the conversion
Most recently I have come across another interesting way to do the same conversion, i.e. using the
unary plus operator (
+ ). The above two statements can be rewritten as following to achieve the same result