Created
September 11, 2017 18:39
-
-
Save Smakar20/ce8bb2a3123400364feceb41ec585890 to your computer and use it in GitHub Desktop.
null created by smakar20 - https://repl.it/Kovh/1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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