Skip to content

Commit fd72b0f

Browse files
Refine comments for clarity on totalMinutes calculation and improve explanation of its purpose
1 parent f5658c8 commit fd72b0f

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

‎Sprint-2/3-mandatory-interpret/2-time-format.js‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,9 @@ console.log(result);
2525
//ANSWER: The expression movieLength % 60 uses the remainder (%) operator to calculate the number of seconds remaining that can't form a full seconds (8784 % 60 = 24 seconds)
2626

2727
// d) Interpret line 4, what does the expression assigned to totalMinutes mean?
28-
// ANSWER: The expression assigned to totalMinutes means division
29-
30-
// d) Interpret line 4, what does the expression assigned to totalMinutes mean?
31-
// ANSWER: It subtracts the remainder seconds from movieLength to get an exact multiple of 60, then divides by 60 to convert the seconds into whole minutes (146 minutes).
28+
// ANSWER: The expression `(movieLength - remainingSeconds) / 60` calculates the exact number of full minutes.
29+
// First, `(movieLength - remainingSeconds)` subtracts the remaining seconds from the total seconds to leave a clean multiple of 60.
30+
// Then, dividing that result by 60 converts those remaining seconds into whole minutes (8760 / 60 = 146 minutes).
3231

3332
// e) What do you think the variable result represents? Can you think of a better name for this variable?
3433
// ANSWER: A better name for the variable would be 'formattedDuration' because it clearly describes that the variable stores the movie duration in a formatted hours, minutes, and seconds format.

0 commit comments

Comments
 (0)