@@ -44,22 +44,20 @@ console.log(`The percentage change is ${percentageChange}`);
4444 // now with the number cleaned we can convert this string in number with the method Number().
4545
4646
47-
48-
49-
5047
48+ // ---------- console.log each step to see the results ----------
5149
52- // let carPrice = "10,000";
53- // let priceAfterOneYear = "8,543";
50+ // let carPrice = "10,000";
51+ // let priceAfterOneYear = "8,543";
5452
55- // carPrice = Number(carPrice.replaceAll(",", ""));
56- // console.log(carPrice); // the commas are removed and the string is converted to a number
53+ // carPrice = Number(carPrice.replaceAll(",", ""));
54+ // console.log(carPrice); // the commas are removed and the string is converted to a number
5755
58- // priceAfterOneYear = Number(priceAfterOneYear.replaceAll(",", ""));
59- // console.log(priceAfterOneYear); // the commas are removed and the string is converted to a number
56+ // priceAfterOneYear = Number(priceAfterOneYear.replaceAll(",", ""));
57+ // console.log(priceAfterOneYear); // the commas are removed and the string is converted to a number
6058
61- // const priceDifference = carPrice - priceAfterOneYear;
62- // console.log(`The price difference is ${priceDifference}`);
59+ // const priceDifference = carPrice - priceAfterOneYear;
60+ // console.log(`The price difference is ${priceDifference}`);
6361
64- // const percentageChange = (priceDifference / carPrice) * 100;
65- // console.log(`The percentage change is ${percentageChange}`);
62+ // const percentageChange = (priceDifference / carPrice) * 100;
63+ // console.log(`The percentage change is ${percentageChange}`);
0 commit comments