Skip to content

Commit d1304cb

Browse files
committed
interpret 1 exercise complete
1 parent 9eda7a1 commit d1304cb

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,15 @@ console.log(`The percentage change is ${percentageChange}`);
1212
// Read the code and then answer the questions below
1313

1414
// a) How many function calls are there in this file? Write down all the lines where a function call is made
15-
15+
//there are 4 function calls
16+
//Number(carPrice.replaceAll(",", ""));
17+
//priceAfterOneYear = Number(priceAfterOneYear.replaceAll("," ""));
1618
// 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?
17-
19+
//there is an error on line 5 , there should be a comma seperating the two arguments
1820
// c) Identify all the lines that are variable reassignment statements
19-
21+
//line 4 and 5
2022
// d) Identify all the lines that are variable declarations
21-
23+
//line 1 and 2
24+
//line 7 and 8
2225
// e) Describe what the expression Number(carPrice.replaceAll(",","")) is doing - what is the purpose of this expression?
26+
//this expression replaces all commas in the carPrice variable with nothing instead

0 commit comments

Comments
 (0)