Use the parseInt() method in JavaScript to return an integer after parsing a string. You can also set the numeral system as a second parameter.
Example
You can try to run the following code to learn how to work with parseFloat() method in JavaScript.
<!DOCTYPE html>
<html>
<body>
<script>
var val1 = parseInt("20.50");
var val2 = parseInt("30 minutes");
var val3 = parseInt("20",16);
document.write(val1);
document.write("<br>"+val2);
document.write("<br>"+val3);
</script>
</body>
</html>