Skip to content

Commit 0071257

Browse files
committed
modifed answers of 3-mandatory-interpret 1-percentage-change.js
1 parent a12ff6e commit 0071257

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ 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-
//A: 3
15+
//A: 6
1616
//carPrice = Number(carPrice.replaceAll(",", ""));
1717
//priceAfterOneYear = Number(priceAfterOneYear.replaceAll("," ""));
1818
//console.log(`The percentage change is ${percentageChange}`);
@@ -27,6 +27,8 @@ console.log(`The percentage change is ${percentageChange}`);
2727
// d) Identify all the lines that are variable declarations
2828
//const priceDifference = carPrice - priceAfterOneYear;
2929
//const percentageChange = (priceDifference / carPrice) * 100;
30+
//let carPrice = "10,000";
31+
//let priceAfterOneYear = "8,543";
3032

3133
// e) Describe what the expression Number(carPrice.replaceAll(",","")) is doing - what is the purpose of this expression?
32-
//A: replacing , with empty string.
34+
//A: replacing , with empty string. number() is convert text to number.

0 commit comments

Comments
 (0)