Advertisement
Guest User

Untitled

a guest
Jan 19th, 2020
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function sumseconds (input){
  2.  
  3.     let timeFirst= (input.shift());
  4.     let timeSecond= (input.shift());
  5.     let timeThird= (input.shift());
  6.     let totaltime = timeFirst + timeSecond + timeThird;
  7.      console.log(totaltime);
  8.    let minutes = Math.floor(totaltime/60);
  9.     let seconds = (totaltime %60 );
  10.  
  11.     if (seconds<10){
  12.     console.log (`${minutes}:0${seconds}`)
  13.     }
  14.     else {
  15.         console.log(`${minutes}:${seconds}`)
  16.     }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement