@@ -8,8 +8,8 @@ const totalHours = (totalMinutes - remainingMinutes) / 60;
88
99const result = `${ totalHours } :${ remainingMinutes } :${ remainingSeconds } ` ;
1010console . log ( result ) ;
11- let movieDuration = `${ totalHours } :${ remainingMinutes } :${ remainingSeconds } ` ;
12- console . log ( movieDuration ) ;
11+ let formattedDuration = `${ totalHours } :${ remainingMinutes } :${ remainingSeconds } ` ;
12+ console . log ( formattedDuration ) ;
1313// For the piece of code above, read the code and then answer the following questions
1414
1515
@@ -28,9 +28,9 @@ console.log(movieDuration);
2828//we are converting the seconds into minutes by dividing by 60
2929
3030// e) What do you think the variable result represents? Can you think of a better name for this variable?
31- // we can change the name of the variable result into a clearer variable name like movieDuration
31+ // we can change the name of the variable result into a clearer variable name like formattedDuration
3232//and if i want to change or update the value later i can use let instead of const
33- // let movieDuration = `${totalHours}:${remainingMinutes}:${remainingSeconds}`;
34- //the result will be the duration of the movie in hours, minutes, and seconds.
33+ // formattedDuration = `${totalHours}:${remainingMinutes}:${remainingSeconds}`;
34+ //the result will be the duration of the movie in hours, minutes, and seconds(hh:mm:ss) format
3535// f) Try experimenting with different values of movieLength. Will this code work for all values of movieLength? Explain your answer
3636//yes it will work for all values of movieLength because the code will always convert seconds into hours, minutes, and seconds format.
0 commit comments