1parseInt(value);
2
3let string = "321"
4console.log(string); // "321" <= string
5
6let number = parseInt(string);
7console.log(number) // 321 <=int
1var myInt = parseInt("10.256"); //10
2var myFloat = parseFloat("10.256"); //10.256
1var text = '42px';
2var integer = parseInt(text, 10);
3// returns 42
4let myNumber = Number("5.25"); //5.25
1var myInt = parseInt("10.256"); //10
2var myFloat = parseFloat("10.256"); //10.256
1// parseInt
2parseInt("10");//------------ 10
3parseInt("10.00");//--------- 10
4parseInt("10.33")//--------- 10
5parseInt("34 45 66")//------ 34
6parseInt(" 60 ")//------ 60
7parseInt("40 years")//------ 40
8parseInt("He was 40")//----- NaN
9parseInt("10", 10)//-------- 10
10parseInt("010")//----------- 10
11parseInt("10", 8)//--------- 8
12parseInt("0x10")//---------- 16
13parseInt("10", 16)//-------- 16
14// parseFloat
15parseFloat("10")//-----------10
16parseFloat("10.00")//--------10
17parseFloat("10.33")//--------10.33
18parseFloat("34 45 66")//-----34
19parseFloat(" 60 ")//---------60
20parseFloat("40 years")//-----40
21parseFloat("He was 40");//----NaN
22/ mm.mirzaei /
1parseInt(" 0xF", 16);
2parseInt(" F", 16);
3parseInt("17", 8);
4parseInt(021, 8);
5parseInt("015", 10);
6parseInt(15.99, 10);
7parseInt("FXX123", 16);
8parseInt("1111", 2);
9parseInt("15*3", 10);
10parseInt("15e2", 10);
11parseInt("15px", 10);
12parseInt("12", 13);
13
14//Return: 15