The parseInt() method
The
parseInt()
method accepts a string and returns the numerical value. It can be used to convert a string type to a numeric type. For float values, parseFloat()
can be used:
var stringOne = "1"; var intOne = parseInt(stringOne);