Skip to content

Instantly share code, notes, and snippets.

@Smakar20
Created September 11, 2017 18:39
Show Gist options
  • Save Smakar20/ce8bb2a3123400364feceb41ec585890 to your computer and use it in GitHub Desktop.
Save Smakar20/ce8bb2a3123400364feceb41ec585890 to your computer and use it in GitHub Desktop.
null created by smakar20 - https://repl.it/Kovh/1
/* Have the function TimeConvert(num) take the num parameter being passed and return the number of hours and minutes
the parameter converts to (ie. if num = 63 then the output should be 1:3). Separate the number of hours and minutes
with a colon. */
(function timeConvert(num) {
// code goes here
if(num == 0) return "0:0"
if(num < 60) return "0:" + num.toString()
return Math.floor((num/60)).toString() + ":" + (num%60).toString()
}(100))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment