Skip to content

Commit f8a6510

Browse files
author
Payman IB
committed
Lines 26 & 43 updated.
1 parent 870693a commit f8a6510

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ console.log(`The percentage change is ${percentageChange}`);
2323
// 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?
2424

2525
// line 5
26-
// priceAfterOneYear = Number(priceAfterOneYear.replaceAll("," "")); the error is a missing "," in ...replaceAll("," , "")). with out a "," the " "" are not separated and computer read them together.
26+
// priceAfterOneYear = Number(priceAfterOneYear.replaceAll("," "")); the error is a missing comma between the two arguments in the .replaceAll() function call. Without the comma,
27+
// the two string arguments "," and "" are not separated, so the computer reads them together as one argument.
2728

2829
// c) Identify all the lines that are variable reassignment statements
2930

@@ -40,4 +41,4 @@ console.log(`The percentage change is ${percentageChange}`);
4041
// lines 1,2,7,8
4142

4243
// e) Describe what the expression Number(carPrice.replaceAll(",","")) is doing - what is the purpose of this expression?
43-
// it replace the "," with "" which means omitting the "," so we have whole number that computer can work with it.
44+
// It replace the "," with "" which means omitting the "," and add nothing so we have whole number form that computer can work with it.

0 commit comments

Comments
 (0)