1let theInt = parseInt("5.90123"); //5
2let theFloat = parseFloat("5.90123"); //5.90123
1//It accepts two arguments.
2//The first argument is the string to convert.
3//The second argument is called the radix. This is the base number used in mathematical systems. For our use, it should always be 10.
4
5
6var text = '42px';
7var integer = parseInt(text, 10);
8
9
10// returns 42
1<script language="JavaScript" type="text/javascript">
2var a = "3.3445";
3var c = parseFloat(a);
4alert(c);
5</script>
6
1const stringPrices = ['5.47', '3.12', '8.00', '5.63', '10.70'];
2let priceTotal = 0;
3
4// priceTotal should be: 32.92
5// Write your code below
6
7stringPrices.forEach(stringPrice => {
8price = parseFloat(stringPrice);
9 priceTotal += price;
10});