File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Sprint-2/4-mandatory-interpret Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -24,9 +24,9 @@ function formatTimeDisplay(seconds) {
2424
2525// b) What is the value assigned to num when pad is called for the first time?
2626// =============> The first call is for totalHours, and when you call formatTimeDisplay(61), the value of totalHours is:
27- //totalHours = (61 - 1) / 60 = 60 / 60 = 1, remainingMinutes = 1
28- //totalHours = totalMinutes - remainingMinutes = 1 - 1 = 0
29- // So, num = 0 for the first pad call.
27+ // remainingSeconds = 61%60 = 1
28+ // totalMinutes = (61-1)/60 = 1 remainingMinutes = 1%60 =1
29+ // totalHours =(1-1)/60 = 0 so the value assigned to num is 0 when pad is called for the first time
3030
3131// c) What is the return value of pad is called for the first time?
3232// =============> The return value is "00" because pad(0) results in "00" using .padStart(2, "0").
You can’t perform that action at this time.
0 commit comments