You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 5b6ddbd
Browse filesBrowse the repository at this point in the historyBrowse files
@@ -12,11 +12,18 @@ console.log(`The percentage change is ${percentageChange}`);
12
12
// Read the code and then answer the questions below
13
13
14
14
// a) How many function calls are there in this file? Write down all the lines where a function call is made
15
+
// line 4, number() and replaceAll()
16
+
// line 5, number() and replaceAll()
17
+
// line 10, console.log()
15
18
16
19
// b) Run the code and identify the line where the error is coming from - why is this error occurring? How can you fix this problem?
20
+
// The was a missing comma in line 5.
17
21
18
22
// c) Identify all the lines that are variable reassignment statements
23
+
// line 4 and line 5
19
24
20
25
// d) Identify all the lines that are variable declarations
26
+
// line 1,line 2, line 7, line 8
21
27
22
28
// e) Describe what the expression Number(carPrice.replaceAll(",","")) is doing - what is the purpose of this expression?
29
+
// The expression changes the string to a number and removes the comma. This makes it possible for Javascript to perform subtraction since it is no longer a string
0 commit comments