Skip to content

Commit dd75584

Browse files
committed
used -2 to extract last 2 characters instead of start and extract (2, 5)
1 parent a1ae7a3 commit dd75584

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sprint-2/5-stretch-extend/format-time.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
function formatAs12HourClock(time) {
66
const hours = Number(time.slice(0, 2));
7-
const minutes = time.slice(3, 5);
7+
const minutes = time.slice(-2);
88

99
if (hours === 0) {
1010
return `12:${minutes} am`;

0 commit comments

Comments
 (0)