Skip to content

Commit 4361e74

Browse files
committed
Complete 4-mandatory-interpret
1 parent 29f55b4 commit 4361e74

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

Sprint-2/4-mandatory-interpret/time-format.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,21 @@ function formatTimeDisplay(seconds) {
1717
// Questions
1818

1919
// a) When formatTimeDisplay is called how many times will pad be called?
20-
// =============> write your answer here
20+
// =============> 3 times
2121

2222
// Call formatTimeDisplay with an input of 61, now answer the following:
23+
console.log(formatTimeDisplay(61));
2324

2425
// b) What is the value assigned to num when pad is called for the first time?
25-
// =============> write your answer here
26+
// =============> 0
2627

2728
// c) What is the return value of pad is called for the first time?
28-
// =============> write your answer here
29+
// =============> "00"
2930

3031
// d) What is the value assigned to num when pad is called for the last time in this program? Explain your answer
31-
// =============> write your answer here
32+
// =============> 1
33+
// The last call to pad is for remaining seconds, which is 1 (since 61 % 60 = 1)
3234

3335
// e) What is the return value assigned to num when pad is called for the last time in this program? Explain your answer
34-
// =============> write your answer here
36+
// =============> "01"
37+
// pad(1) returns "01" because padStart(2, "0") adds a leading zero

0 commit comments

Comments
 (0)