Skip to content

Commit d6a7f93

Browse files
committed
Add explanation for totalMinutes calculation in 2-time-format.js
1 parent b96468b commit d6a7f93

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,9 @@ console.log(result);
3939

4040
// c) In the expression 'movieLength % 60', '%' represents the remainder operator. It returns the value that of what is left over after dividing the left operand by the right operand as many whole times as possible.
4141
// Since movieLength = 8784, it means: 8784 % 60, which returns a result of 146 remainder 24.
42-
// Therefore, movieLength % 60 (8784 % 60) returns the leftover value '24'. In this context, the leftover represents the loose seconds that add up to a full minute.
42+
// Therefore, movieLength % 60 (8784 % 60) returns the leftover value '24'. In this context, the leftover represents the loose seconds that add up to a full minute.
43+
44+
// d) The expression assigned to totalMinutes simply means, we subtract the loose seconds, '24', from movieLength, '8784'. The result becomes a number easily divisible by 60
45+
// That is: totalMinutes = (8784 - 24);
46+
// which gives 8760, and then divides it 60;
47+
// the result, 146, is the total number of complete minutes contained in the movie

0 commit comments

Comments
 (0)