Ad
Fundamentals
Strings
Data Types
Code
Diff
  • const minutes = (n) => {
      const hours = Math.floor(n / 60);
      const minutes = n % 60;
      const zeroPad = minutes < 10 ? `0` : ``;
      return `${hours}:${zeroPad}${minutes}`;
    }
    • const minutes = (n) => `${~~(n / 60)}:${~~(n % 60 / 10)}${(n % 60 % 10)}`;
    • const minutes = (n) => {
    • const hours = Math.floor(n / 60);
    • const minutes = n % 60;
    • const zeroPad = minutes < 10 ? `0` : ``;
    • return `${hours}:${zeroPad}${minutes}`;
    • }