Skip to content

Commit 2f73154

Browse files
completed part 2 of e
1 parent add60e5 commit 2f73154

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,5 @@ console.log(`The percentage change is ${percentageChange}`);
2020
// d) Identify all the lines that are variable declarations
2121
// Answer: Lines 1, 2, 7 and 8
2222
// e) Describe what the expression Number(carPrice.replaceAll(",","")) is doing - what is the purpose of this expression?
23-
// Answer: It removes all the commas from the string carPrice and turns it into a number that can be used in calculations
23+
// Answer: The purpose is to remove the comma from carPrice and turn it into a number, so it can be used in the calculation.
24+
// Without doing this, JavaScript would treat it like a string instead of a proper number.

0 commit comments

Comments
 (0)