There was an error while loading. Please reload this page.
1 parent 5259e12 commit 26b2e4dCopy full SHA for 26b2e4d
1 file changed
Sprint-2/3-mandatory-interpret/1-percentage-change.js
@@ -2,7 +2,7 @@ let carPrice = "10,000";
2
let priceAfterOneYear = "8,543";
3
4
carPrice = Number(carPrice.replaceAll(",", ""));
5
-priceAfterOneYear = Number(priceAfterOneYear.replaceAll("," ""));
+priceAfterOneYear = Number(priceAfterOneYear.replaceAll(",", ""));
6
7
const priceDifference = carPrice - priceAfterOneYear;
8
const percentageChange = (priceDifference / carPrice) * 100;
@@ -46,5 +46,3 @@ console.log(...) */
46
/* e) the expression Number(carPrice.replaceAll(",","")) removes the commas from the price string
47
and then converts it into a number. This is done so the price can be used in
48
calculations like subtraction and division. */
49
-
50
0 commit comments