Skip to content

Commit fe7ed0b

Browse files
committed
fixed the line error for github comment
1 parent 5727026 commit fe7ed0b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ console.log(`The percentage change is ${percentageChange}`);
2020
// line 10: console.log(`The percentage change is ${percentageChange}`);
2121

2222
// 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?
23-
// The error is occurring on 4 where we are trying to convert the string values of carPrice and priceAfterOneYear to numbers using the Number function. The error is occurring because the replaceAll method is being called on a string that has not been updated with the new value after the first replaceAll call. To fix this problem, we can update the carPrice and priceAfterOneYear variables with the new values after the replaceAll calls. For example:
23+
// Error on line 5 where comma was missing in replaceAll function call.
2424

2525
// c) Identify all the lines that are variable reassignment statements
2626
// Line 4: carPrice = Number(carPrice.replaceAll(",", ""));

0 commit comments

Comments
 (0)