Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function time(input) {
- let startHour = Number(input.shift());
- let startMin = Number(input.shift());
- let timeInMin = startHour * 60 + startMin;
- let timePlus15 = timeInMin + 15;
- let finalHour = (timePlus15 / 60)
- let finalMin = timePlus15 % 60
- if (finalHour <= 24) {
- finalHour -= 24;
- } if (finalMin < 10) {
- console.log(`${finalHour}:0${finalMin}`);
- } else if (finalMin > 10) {
- console.log(`${finalHour}:${finalMin}`)
- }
- }
- time([1, 46])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement