File tree Expand file tree Collapse file tree
Sprint-3/4-mandatory-interpret Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -22,17 +22,22 @@ function formatTimeDisplay(seconds) {
2222
2323// a) When formatTimeDisplay is called how many times will pad be called?
2424// =============> write your answer here
25+ // 3 times
2526
2627// Call formatTimeDisplay with an input of 61, now answer the following:
2728
2829// b) What is the value assigned to num when pad is called for the first time?
2930// =============> write your answer here
31+ // 0
3032
3133// c) What is the return value of pad when it is called for the first time?
3234// =============> write your answer here
33-
35+ // string "00"
3436// d) What is the value assigned to num when pad is called for the last time in this program? Explain your answer
3537// =============> write your answer here
36-
38+ // remainingSeconds is 1, the last pad will execute so the function will divide 61 by 60 and then return the modulus or remainder which is 1.
3739// e) What is the return value of pad when it is called for the last time in this program? Explain your answer
3840// =============> write your answer here
41+ // "01", The pad function recieves the number 1 and converts it to a number string.
42+ // The while loop checks the string length to get 1. 1 is less than 2 therefore the loop executes and adds a 0 to the string giving "01".
43+ // The loop will finishes because 2 is not less than 2. The function returns "01"
You can’t perform that action at this time.
0 commit comments