Introduction
In this lab, we will explore the formatSeconds
function in JavaScript. This function returns the ISO format of a given number of seconds by dividing the seconds into appropriate values for hours, minutes and seconds. We will learn how to use Array.prototype.map()
, Math.floor()
, String.prototype.padStart()
and Array.prototype.join()
to format and combine the values into a string. By the end of this lab, you will have a solid understanding of how to manipulate and format time data in JavaScript.