Skip to content

Commit 26d443e

Browse files
committed
Modified the answer to question C
1 parent 4f42d5d commit 26d443e

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
@@ -3,7 +3,7 @@ let priceAfterOneYear = "8,543";
33

44
carPrice = Number(carPrice.replaceAll(",", ""));
55
priceAfterOneYear = Number(priceAfterOneYear.replaceAll(",", ""));
6-
6+
console.log(carPrice)
77
const priceDifference = carPrice - priceAfterOneYear;
88
const percentageChange = (priceDifference / carPrice) * 100;
99

@@ -16,7 +16,7 @@ console.log(`The percentage change is ${percentageChange}`);
1616
// 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?
1717
// It was a syntax error, it can be fixed by adding the missing part (1 of 2 parentheses)
1818
// c) Identify all the lines that are variable reassignment statements
19-
// 4, 5
19+
// 4, 5, 7, 8
2020
// d) Identify all the lines that are variable declarations
2121
// 1, 2
2222
// e) Describe what the expression Number(carPrice.replaceAll(",","")) is doing - what is the purpose of this expression?

0 commit comments

Comments
 (0)