Skip to content

Commit 644248f

Browse files
authored
communicating the valuable comments
1 parent 76ab3c7 commit 644248f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Sprint-2/3-mandatory-implement/2-cases.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
// Use the MDN string documentation to help you find a solution
1616
// This might help https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toUpperCase
1717
function toUpperCase(text) {
18-
return text.replace(" ", "_").toUpperCase();
18+
eturn text.replace(/ /g, "_").toUpperCase();
1919
}
2020

2121
console.log(toUpperCase("hello there"));

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
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
const ampm = hours >= 12 ? "pm" : "am";
9-
const Hour = String(hours % 12 === 0 ? 12 : hours % 12).padStart(2, "0")
10-
return `${Hour}:${minutes} ${ampm}`;
9+
const hour = String(hours % 12 === 0 ? 12 : hours % 12).padStart(2, "0")
10+
return `${hour}:${minutes} ${ampm}`;
1111
}
1212

1313

0 commit comments

Comments
 (0)