Skip to content

Commit 9e484d4

Browse files
committed
Update my answer to 3-mandatory-interpret/1-percentage-change.js
1 parent 34421f1 commit 9e484d4

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,6 @@ console.log(`The percentage change is ${percentageChange}`);
2828

2929
// e) Describe what the expression Number(carPrice.replaceAll(",","")) is doing - what is the purpose of this expression?
3030

31-
// Martin answer - the purpose of this expression is to use the replace all method to replace the comma in the carPrice price expression with a blank so that the expression reads "10000". This is converted to a number using the number function converting the string "10000" to a number 10000
31+
/*
32+
Martin answer - the purpose of this expression is to use the replaceAll method using a search string and replacement string. In this case all commas are removed from carPrice (",") and replaced with a blank (""), converting the formatted number of "10,000" to "10000". This is passed into a Number() method which converts the string to a number - 10000
33+
*/

0 commit comments

Comments
 (0)