-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathassertions-exercise.js
More file actions
25 lines (21 loc) · 795 Bytes
/
Copy pathassertions-exercise.js
File metadata and controls
25 lines (21 loc) · 795 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// const calculation = 10 + 32;
// const result = 40;
// console.assert(calculation === result);
// function formatAs12HourClock() {}
// console.log(formatAs12HourClock())
// console.assert(formatAs12HourClock("08:00") === "08:00 am" , `current output: ${formatAs12HourClock("08:00")} , target output: 08:00 am`);
function formatAs12HourClock(time) {
return `${time} am`;
}
const currentOutput = formatAs12HourClock("08:00");
const targetOutput = "08:00 am";
console.assert(
currentOutput === targetOutput,
`current output: ${currentOutput}, target output: ${targetOutput}`
);
const currentOutput1 = formatAs12HourClock("23:00");
const targetOutput1 = "11:00 pm";
console.assert(
currentOutput === targetOutput,
`current output: ${currentOutput}, target output: ${targetOutput}`
);