Skip to content

Commit 2ec33a8

Browse files
answered the questions for time-format.js
1 parent 95ce71d commit 2ec33a8

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,18 @@ function formatTimeDisplay(seconds) {
2222

2323
// a) When formatTimeDisplay is called how many times will pad be called?
2424
// =============> write your answer here
25-
25+
// pad will be called 3 times, once for each of the totalHours, remaininngMinutes, and remainingSeconds variables that are passed to the pad function in the return statement of formatTimeDisplay.
2626
// Call formatTimeDisplay with an input of 61, now answer the following:
27-
27+
//
2828
// b) What is the value assigned to num when pad is called for the first time?
2929
// =============> write your answer here
30-
30+
// the value assigned to num when pad is called for the first time is 0, which is the value of totalHours when formatTimeDisplay is called with an input of 61. This is because 61 seconds is equal to 1 minute and 1 second, which means there are 0 hours, 1 minute, and 1 second. Therefore, totalHours is 0, and this value is passed to the pad function as the argument num in return `${pad(totalHours)}:${pad(remainingMinutes)}:${pad(remainingSeconds)}`;}.
3131
// c) What is the return value of pad when it is called for the first time?
3232
// =============> write your answer here
33-
33+
// the return value of pad when it is called for the first time is "00".
3434
// d) What is the value assigned to num when pad is called for the last time in this program? Explain your answer
3535
// =============> write your answer here
36-
36+
// when pad is called for the last time in this program, the value assigned to num is 1, which is the value of remainingSeconds.
3737
// e) What is the return value of pad when it is called for the last time in this program? Explain your answer
3838
// =============> write your answer here
39+
// the return value of pad when it is called for the last time in this program is "01".

0 commit comments

Comments
 (0)