Need help, in cursera task by js, you need to display the correct time, when adding an interval.
module.exports = function(hours, minutes, interval) { if (hours >= 0, hours <= 23, minutes >= 0, minutes <= 59) { if (minutes + interval >= 60) { hours = hours + 1; minutes = (minutes + interval - 60) } else { minutes = minutes + interval }; if (minutes.length = 1) { miutes = '0' + minutes }; return hours + ':' + minutes } else {}; }; The bottom line is that I can’t figure out how to do it so that instead of 1, 01 comes to a conclusion. There was a hint on the site:
To perform this task, you may need methods from the global Math object. For example, the floor method.
return ('00' + hours).slice(-2) + ':' + ('00' + minutes).slice(-2);- Rostyslav Kuzmovych