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 8fb5a39 commit 029c9bcCopy full SHA for 029c9bc
Sprint-2/5-stretch-extend/format-time.js
@@ -4,8 +4,8 @@
4
5
function formatAs12HourClock(time) {
6
// Expect time in "HH:MM" format
7
- let hours = Number(time.slice(0, 2));
8
- let mins = time.slice(3);
+ const hours = Number(time.slice(0, 2));
+ const mins = time.slice(3);
9
10
if (hours === 0) {
11
return `12:${mins} am`;
@@ -16,7 +16,7 @@ function formatAs12HourClock(time) {
16
}
17
18
if (hours > 12) {
19
- let newHr = hours - 12;
+ const newHr = hours - 12;
20
// pad single digits like 1:00 -> 01:00
21
return `${String(newHr).padStart(2, "0")}:${mins} pm`;
22
0 commit comments