Skip to content

Commit 72dfb0c

Browse files
committed
answered b)
1 parent 3145e30 commit 72dfb0c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎Sprint-2/3-mandatory-interpret/1-percentage-change.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ let carPrice = "10,000";
22
let priceAfterOneYear = "8,543";
33

44
carPrice = Number(carPrice.replaceAll(",", ""));
5-
priceAfterOneYear = Number(priceAfterOneYear.replaceAll("," ""));
5+
priceAfterOneYear = Number(priceAfterOneYear.replaceAll(",",""));
66

77
const priceDifference = carPrice - priceAfterOneYear;
88
const percentageChange = (priceDifference / carPrice) * 100;
@@ -19,7 +19,7 @@ console.log(`The percentage change is ${percentageChange}`);
1919

2020

2121
// b) Run the code and identify the line where the error is coming from - why is this error occurring? How can you fix this problem?
22-
22+
// The error is coming from line 5. There is a separator missing from the function call. Insert a comma to fix the problem.
2323
// c) Identify all the lines that are variable reassignment statements
2424

2525
// d) Identify all the lines that are variable declarations

0 commit comments

Comments
 (0)