Skip to content

Commit a3a586e

Browse files
committed
3 Mandatory interpret - 1 percentage change: Answered the questions from a-e
1 parent 29cd03f commit a3a586e

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,11 @@ console.log(`The percentage change is ${percentageChange}`);
2020
// d) Identify all the lines that are variable declarations
2121

2222
// e) Describe what the expression Number(carPrice.replaceAll(",","")) is doing - what is the purpose of this expression?
23+
24+
// a) There are 5 calls made:
25+
// carPrice = Number(carPrice.replaceAll(",", ""));
26+
// priceAfterOneYear = Number(priceAfterOneYear.replaceAll("," ""))
27+
// b) Error on line 5 for "," it is missing the seperating , between "," and "".
28+
// c) 4 and 5
29+
// d) 1 and 2, 7 and 8,
30+
// e) It removes the , from the string and replaces it with nothing. Used to help change the string into a number with the "Number" function.

0 commit comments

Comments
 (0)