Skip to content

Commit e522512

Browse files
fixed the mistakes in 2/2 and 2/5
1 parent 759b9c5 commit e522512

File tree

2 files changed

+24
-10
lines changed

2 files changed

+24
-10
lines changed

Sprint-2/2-mandatory-debug/0.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ console.log(`The result of multiplying 10 and 32 is ${multiply(10, 32)}`);
1313

1414
// Finally, correct the code to fix the problem
1515
// =============> write your new code here :
16-
// function multiply(a, b) {
17-
// return a * b;
18-
// }
19-
// console.log(`The result of multiplying 10 and 32 is ${multiply(10, 32)}`);
16+
function multiply(a, b) {
17+
return a * b;
18+
}
19+
console.log(`The result of multiplying 10 and 32 is ${multiply(10, 32)}`);

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

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,24 @@ function formatAs12HourClock(time) {
2020

2121
return `${time} am`;
2222
}
23-
console.log(formatAs12HourClock("00:00"));
24-
console.log(formatAs12HourClock("01:00"));
25-
console.log(formatAs12HourClock("11:00"));
26-
console.log(formatAs12HourClock("12:00"));
27-
console.log(formatAs12HourClock("13:00"));
28-
console.log(formatAs12HourClock("23:00"));
23+
console.assert(
24+
formatAs12HourClock("08:00") === "08:00 am",
25+
"08:00 should be 08:00 am"
26+
);
27+
console.assert(
28+
formatAs12HourClock("00:00") === "12:00 am",
29+
"00:00 should be 12:00 am"
30+
);
31+
console.assert(
32+
formatAs12HourClock("12:00") === "12:00 pm",
33+
"12:00 should be 12:00 pm"
34+
);
35+
console.assert(
36+
formatAs12HourClock("13:45") === "01:45 pm",
37+
"13:45 should be 01:45 pm"
38+
);
39+
console.assert(
40+
formatAs12HourClock("01:30") === "01:30 am",
41+
"01:30 should be 01:30 am"
42+
);
2943

0 commit comments

Comments
 (0)