@@ -22,15 +22,16 @@ console.log(`The percentage change is ${percentageChange}`);
2222// e) Describe what the expression Number(carPrice.replaceAll(",","")) is doing - what is the purpose of this expression?
2323
2424
25- // a) There are 3 function calls in this file:
25+ // a) There are 5 function calls in this file:
2626// `carPrice.replaceAll(",", "")` on line 5
2727// `priceAfterOneYear.replaceAll(",", "")` on line 6
28- // `Number(...)` on lines 5 and 6
29- // b) The error occurs on line 5 there's a missing comma.
28+ // `Number(...)` on lines 4 and 5
29+ // console.log on line 10.
30+ // b) A comma is missing between the first and second string arguments which causes the error.
3031//c) The variable reassignment statements are:
3132// `carPrice = Number(carPrice.replaceAll(",", ""));` on line 5
3233// `priceAfterOneYear = Number(priceAfterOneYear.replaceAll(",", ""));` on line 6
3334// d) The variable declarations are:
3435// `let carPrice = "10,000";` on line 1
3536// `let priceAfterOneYear = "8,543";` on line 2
36- // e) The expression `Number(carPrice.replaceAll(",", ""))` is converting carprice , which contains a comma, into a number.
37+ // e) The expression `Number(carPrice.replaceAll(",", ""))` is converting car price , which contains a comma, into a number.
0 commit comments