We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cb65771 commit eeb1c24Copy full SHA for eeb1c24
Sprint-3/alarmclock/alarmclock.js
@@ -2,11 +2,8 @@ let timeRemaining;
2
let timerInterval;
3
4
function formatTime(time) {
5
- const minutes =
6
- Math.floor(time / 60) < 10
7
- ? "0" + Math.floor(time / 60)
8
- : Math.floor(time / 60);
9
- const seconds = time % 60 < 10 ? "0" + (time % 60) : time % 60;
+ const minutes = String(Math.floor(time / 60)).padStart(2, "0");
+ const seconds = String(time % 60).padStart(2, "0");
10
11
return `${minutes}:${seconds}`;
12
}
0 commit comments