rsschool-cv

Roman Kavalenka

photo


Contacts


About Me

Programming is my hobby. I enjoy solving problems and dealing with difficulties.


Skils


Languages


Projects


Code example

Write a function, which takes a non-negative integer (seconds) as input and returns the time in a human-readable format (HH:MM:SS)

The maximum time never exceeds 359999 (99:59:59)

function humanReadable(seconds) {
  let hh = String('0' + Math.trunc(seconds / 60 / 60)).slice(-2);
  let mm = String('0' + Math.trunc(seconds / 60 % 60)).slice(-2);
  let ss = String('0' + Math.trunc(seconds % 60 % 60)).slice(-2);
  return `${hh}:${mm}:${ss}`;
}

Courses and book