Advertisement
Guest User

Untitled

a guest
Feb 13th, 2020
299
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. function timePlusMins(input) {
  2. let h = Number(input.shift());
  3. let m = Number(input.shift()) + 15;
  4.  
  5. if (m < 60) {
  6. if (m < 10) {
  7. console.log(`${h}:0${m}`);
  8. } else if (m > 10) {
  9. console.log(`${h}:${m}`);
  10. }
  11. } else if (m >= 60){
  12. h += 1;
  13. m = m % 60;
  14. if (m < 10) {
  15. console.log(`${h}:0${m}`)
  16. } else if (m > 10) {
  17. console.log(`${h}:${m}`)
  18. }
  19. }
  20. }
  21.  
  22. timePlusMins(["1", "46"])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement