File tree Expand file tree Collapse file tree
Sprint-2/3-mandatory-interpret Expand file tree Collapse file tree Original file line number Diff line number Diff 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.
You can’t perform that action at this time.
0 commit comments