Skip to content

Commit 6c0dd00

Browse files
committed
Add explanation for Number conversion of carPrice string to enhance clarity
1 parent 69134dc commit 6c0dd00

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,5 @@ console.log(`The percentage change is ${percentageChange}`);
3939
// all left then is just the String digits without ","
4040
// 2. Number("String digit without comma") and this function converts the String digit to number digit
4141
// and finally Number(carPrice.replaceAll(",","")) expression gives us number
42+
43+
// the purpose of Number(carPrice.replaceAll(",","")) is to convert the carPrice string with commas into a clean, usable number so we can perform mathematical calculations on it

0 commit comments

Comments
 (0)