You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Sprint-2/3-mandatory-interpret/2-time-format.js
+8Lines changed: 8 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -23,3 +23,11 @@ console.log(result);
23
23
// e) What do you think the variable result represents? Can you think of a better name for this variable?
24
24
25
25
// 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 variable declarations.
28
+
// b) There is 1 function call. It is on line 10: console.log(result);
29
+
// c) The % operator gives the remainder after dividing movieLength by 60.
30
+
// c) The % operator gives the remainder after dividing movieLength by 60. 60 represents the number of seconds in one minute.
31
+
// d) It subtracts the remaining seconds from the movie length and then divides by 60 to convert the remaining seconds into total minutes.
32
+
// e) The variable result represents the movie duration in hours, minutes and seconds. A better name would be movieDuration.
33
+
// f) The code works for different positive values of movieLength because it converts seconds into hours, minutes and seconds. It expects movieLength to be a number representing seconds.
0 commit comments