File tree Expand file tree Collapse file tree
Sprint-3/4-mandatory-interpret Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11// let padCalls = 0;
22// let padCallCount = 0;
33// let firstNum;
4+ let lastNum ;
45
56function pad ( num ) {
67 // padCalls++;
78 // padCallCount++;
89 // if (padCallCount === 1){
910 // firstNum = num;
1011 // }
12+ lastNum = num ;
1113 let numString = num . toString ( ) ;
1214 while ( numString . length < 2 ) {
1315 numString = "0" + numString ;
@@ -32,7 +34,7 @@ function formatTimeDisplay(seconds) {
3234// console.log(`formatTimeDisplay(${s})==> ${result}| pad called ${padCalls} times `);
3335// }
3436formatTimeDisplay ( 61 ) ;
35- console . log ( "The return value of pad when called for first time is:" , firstReturn ) ;
37+ console . log ( "The value assigned to num when pad is called for the last time is:" , lastNum ) ;
3638
3739// You will need to play computer with this example - use the Python Visualiser https://pythontutor.com/visualize.html#mode=edit
3840// to help you answer these questions
You can’t perform that action at this time.
0 commit comments