Skip to content

Commit c504786

Browse files
debug2604debug2604
authored andcommitted
Debugged the problem of 1-percentage-change.js- a comma is placed betweeen arguments
1 parent ffaed93 commit c504786

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
@@ -2,7 +2,9 @@ let carPrice = "10,000";
22
let priceAfterOneYear = "8,543";
33

44
carPrice = Number(carPrice.replaceAll(",", ""));
5-
priceAfterOneYear = Number(priceAfterOneYear.replaceAll("," ""));
5+
//priceAfterOneYear = Number(priceAfterOneYear.replaceAll("," ""));
6+
7+
priceAfterOneYear = Number(priceAfterOneYear.replaceAll(",",""));
68

79
const priceDifference = carPrice - priceAfterOneYear;
810
const percentageChange = (priceDifference / carPrice) * 100;
@@ -21,7 +23,7 @@ console.log(`The percentage change is ${percentageChange}`);
2123
// There should be a comma to separate arguments
2224

2325
// c) Identify all the lines that are variable reassignment statements
24-
// Variable reassingment statatments on lines 4 and 5.
26+
// Variable reassignment statements on lines 4 and 5.
2527
// Variables carPrice and priceAfterOnYear are originally declared on lines 1 and 2, and reassigned on lines 4 and 5.
2628

2729
// d) Identify all the lines that are variable declarations

0 commit comments

Comments
 (0)