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-3/4-mandatory-interpret/time-format.js
+5Lines changed: 5 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -22,17 +22,22 @@ function formatTimeDisplay(seconds) {
22
22
23
23
// a) When formatTimeDisplay is called how many times will pad be called?
24
24
// =============> write your answer here
25
+
// Pad will be called 3 times because of the 3 arguments
25
26
26
27
// Call formatTimeDisplay with an input of 61, now answer the following:
27
28
28
29
// b) What is the value assigned to num when pad is called for the first time?
29
30
// =============> write your answer here
31
+
0;
30
32
31
33
// c) What is the return value of pad when it is called for the first time?
32
34
// =============> write your answer here
35
+
0;
33
36
34
37
// d) What is the value assigned to num when pad is called for the last time in this program? Explain your answer
35
38
// =============> write your answer here
39
+
// The value is 1 because the last pad argument is remainingSeconds. So 61 as the given seconds - remaining seconds = 1
36
40
37
41
// e) What is the return value of pad when it is called for the last time in this program? Explain your answer
38
42
// =============> write your answer here
43
+
// The answer is 01 because of the final output for formatTimeDisplay(61) is 00:01:01. The assigned value of 1 with the length of 1, the numString = "0" + numString becomes 1
0 commit comments