xxxxxxxxxx
var myInt = parseInt("10.256"); //10
var myFloat = parseFloat("10.256"); //10.256
xxxxxxxxxx
<script language="JavaScript" type="text/javascript">
var a = "3.3445";
var c = parseInt(a);
alert(c);
</script>
xxxxxxxxxx
var text = '42px';
var integer = parseInt(text, 10);
// returns 42
let myNumber = Number("5.25"); //5.25
xxxxxxxxxx
var string = "10";
var integer = parseInt(string);
console.log(typeof(integer)); // int
xxxxxxxxxx
var text = '42px';
var integer = parseInt(text, 10);
// returns 42
xxxxxxxxxx
JavaScript parseInt() Function
var a = parseInt(String)
var a = parseInt("10")