Write a function in javascript that determines the angle between the second and hour hand on a clock given a time.
Anonimo
I'm no JS expert, but first of all I think they'd ask for the minute and hour hands, and not the second hand, otherwise you can't get an accurate measurement of the hour hand degrees: //Difference between minutes and hour hands in degrees function translateTime(minutes,hours) { var degreesMin = (minutes/60) * 360; var degreesHr = (((hours%12)/12)+(minutes/60)*(1/12)) * 360 return (degreesHr-degreesMin)%360; } var output = translateTime(30,3); console.log(output);