Lab 31: Adding up Time with Reduce
Link to Lab 31:
In this Lab, we were assigned to create a page that would display a list of videos and would tally up the time and give a total time it would take to watch all the videos. Although from the front of the lab you can't see how long the videos are, they appear in the actual code. The JavaScript is coded so it adds all the video times and then calculates the hours, minutes, and seconds in total it would take to view the videos. Most of it is possible using simple arithmetic Javascript such as dividing the seconds by 3600 to get the number of hours. In the end, a console log would display the hours, minutes, and seconds left. This was relevantly one of the simpler labs so far and while it definitely isn't that important to know, it is still a nice thing to know.
In this Lab, we were assigned to create a page that would display a list of videos and would tally up the time and give a total time it would take to watch all the videos. Although from the front of the lab you can't see how long the videos are, they appear in the actual code. The JavaScript is coded so it adds all the video times and then calculates the hours, minutes, and seconds in total it would take to view the videos. Most of it is possible using simple arithmetic Javascript such as dividing the seconds by 3600 to get the number of hours. In the end, a console log would display the hours, minutes, and seconds left. This was relevantly one of the simpler labs so far and while it definitely isn't that important to know, it is still a nice thing to know.

Comments
Post a Comment