Skip to content

Commit 3bb4629

Browse files
authored
Enhance comments for clarity on movie length calculation
Added comments to explain variable usage and code functionality.
1 parent a9900d8 commit 3bb4629

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,12 @@ console.log(result);
2323
// e) What do you think the variable result represents? Can you think of a better name for this variable?
2424

2525
// f) Try experimenting with different values of movieLength. Will this code work for all values of movieLength? Explain your answer
26+
/*
27+
a) There are 6: movieLength, remainingSeconds, totalMinutes, remainingMinutes, totalHours, result.
28+
b) There is one: console.log.
29+
c) It is taking the movieLength and doing a remainder that is showing what is left after the vaule has been divided, in this case wil be 84.
30+
I found the info here https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Remainder
31+
d) It is removing any extra seconds from the division by 60 so that is is showing as whole numbers without decimals.
32+
e) Result is showing the movies duration but broken down to hours:minutes:seconds, I think it should be movieDuration to help describe it better.
33+
f) Yes, it does work to show the lenght even if it is only in one section, though it does show values of 0, could clean it up to show nothing.
34+
*/

0 commit comments

Comments
 (0)