Skip to content

Commit 4c7d3bd

Browse files
committed
practicing
1 parent 04fc458 commit 4c7d3bd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff 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").

0 commit comments

Comments
 (0)