Ad
Fundamentals
Strings
Data Types

Maybe basic math operations will work faster than slice, so we can find first digit of minutes like this

Code
Diff
  • const minutes = (n) => `${~~(n / 60)}:${~~(n % 60 / 10)}${(n % 60 % 10)}`;
    • const minutes = (n) => `${Math.trunc(n / 60)}:${("0" + (n % 60)).slice(-2)}`;
    • const minutes = (n) => `${~~(n / 60)}:${~~(n % 60 / 10)}${(n % 60 % 10)}`;