File tree Expand file tree Collapse file tree 2 files changed +8
-13
lines changed
Expand file tree Collapse file tree 2 files changed +8
-13
lines changed Original file line number Diff line number Diff line change @@ -15,19 +15,19 @@ function formatTimeDisplay(seconds) {
1515// to help you answer these questions
1616
1717// Questions
18-
19- // a) When formatTimeDisplay is called how many times will pad be called? // =============> 3
18+ // a) When formatTimeDisplay is called how many times will pad be called
19+ // // =============> 3
2020
2121// Call formatTimeDisplay with an input of 61, now answer the following:
2222
2323// b) What is the value assigned to num when pad is called for the first time?
24- // =============> write your answer here
24+ // =============> 0
2525
2626// c) What is the return value of pad is called for the first time?
27- // =============> write your answer here
27+ // =============> "00"
2828
2929// d) What is the value assigned to num when pad is called for the last time in this program? Explain your answer
30- // =============> write your answer here
30+ // =============> num=1
3131
3232// e) What is the return value assigned to num when pad is called for the last time in this program? Explain your answer
33- // =============> write your answer here
33+ // =============> "01"
Original file line number Diff line number Diff line change @@ -10,16 +10,11 @@ function formatAs12HourClock(time) {
1010 return `${ time } am` ;
1111}
1212
13+
1314const currentOutput = formatAs12HourClock ( "08:00" ) ;
1415const targetOutput = "08:00 am" ;
1516console . assert (
1617 currentOutput === targetOutput ,
17- `current output: ${ currentOutput } , target output: ${ targetOutput } `
18+ `Expected ${ targetOutput } but got ${ currentOutput } `
1819) ;
1920
20- const currentOutput2 = formatAs12HourClock ( "23:00" ) ;
21- const targetOutput2 = "11:00 pm" ;
22- console . assert (
23- currentOutput2 === targetOutput2 ,
24- `current output: ${ currentOutput2 } , target output: ${ targetOutput2 } `
25- ) ;
You can’t perform that action at this time.
0 commit comments