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
Copy file name to clipboardExpand all lines: Sprint-2/4-mandatory-interpret/time-format.js
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -21,18 +21,18 @@ function formatTimeDisplay(seconds) {
21
21
// Questions
22
22
23
23
// a) When formatTimeDisplay is called how many times will pad be called?
24
-
// =============> write your answer here
24
+
// =============> It will be called 3 times in line 15.
25
25
26
26
// Call formatTimeDisplay with an input of 61, now answer the following:
27
27
28
28
// b) What is the value assigned to num when pad is called for the first time?
29
-
// =============> write your answer here
29
+
// =============> 0 will be assigned to num when pad is called for the first time.
30
30
31
31
// c) What is the return value of pad is called for the first time?
32
-
// =============> write your answer here
32
+
// =============> 00 will be the return value when pad is called the first time.
33
33
34
34
// d) What is the value assigned to num when pad is called for the last time in this program? Explain your answer
35
-
// =============> write your answer here
35
+
// =============> When pad is being called for the last time, it is on line 15 'pad(remainingSeconds)'. So a value of 1 will be assigned to it as remainingSeconds in line 10 was declared as 1.
36
36
37
37
// e) What is the return value of pad when it is called for the last time in this program? Explain your answer
38
-
// =============> write your answer here
38
+
// =============> When pad is being called for the last time, it is on line 15 'pad(remainingSeconds)'. So a value of 1 will be assigned to function pad(num) where num is in value of 1. In line 3, as this string is smaller than 2 which means it is only in 1 digit, we add a '0' in front of it. So it return a numString '01' to the line 15.
0 commit comments