You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
explained my predaction and changed the code by adding 'num' as a paramater to the getLastDigit function to make it accept new paramaters when it's called.
Copy file name to clipboardExpand all lines: Sprint-2/2-mandatory-debug/2.js
+18-3Lines changed: 18 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,8 @@
2
2
3
3
// Predict the output of the following code:
4
4
// =============> Write your prediction here
5
+
// I predict that because the num variable has been given a constant value, the program will give undefiened when the getLastDigt function called after.
6
+
5
7
6
8
constnum=103;
7
9
@@ -14,11 +16,24 @@ console.log(`The last digit of 105 is ${getLastDigit(105)}`);
14
16
console.log(`The last digit of 806 is ${getLastDigit(806)}`);
15
17
16
18
// Now run the code and compare the output to your prediction
0 commit comments