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
Copy file name to clipboardExpand all lines: Sprint-2/1-key-errors/2.js
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -4,18 +4,18 @@
4
4
// this function should square any number but instead we're going to get an error
5
5
6
6
// =============> write your prediction of the error here
7
-
// the error will occur because the paramater of the function is not a valid variable name as it is a number.
8
-
// also the variable num is not declared in the function and this will give an error when the program run because the function will not know what the value of the num is.
// =============> explain this error message here it means that the paramater of the function is an unexpected number (3) and this is not a valid variable number.
Copy file name to clipboardExpand all lines: Sprint-2/2-mandatory-debug/0.js
+7-7Lines changed: 7 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
// Predict and explain first...
2
2
3
3
// =============> write your prediction here
4
-
// I prediact that the error will occur because the function multiply does not return any value and this will make the console.log function to print undefined instead.
console.log(`The result of multiplying 10 and 32 is ${multiply(10,32)}`);
12
12
13
13
// =============> write your explanation here
14
-
// when the program run it give this output:
14
+
whentheprogramrunitgivethis output:
15
15
16
-
// 320
17
-
// The result of multiplying 10 and 32 is undefined
16
+
320
17
+
Theresultofmultiplying10and32isundefined
18
18
19
-
// 320: the out put for the console.log inside the function
19
+
320: theoutputfortheconsole.loginsidethefunction
20
20
21
-
// while the ouout the out put for the console.log function out of the function returned the string provided in the function and an undefiened because the function multibly doesn't return any value.
22
-
// to fix this error we need to change the console.log function inside the function to return.
21
+
whiletheououttheoutputfortheconsole.logfunctionoutofthefunctionreturnedthestringprovidedinthefunctionandanundefienedbecausethefunctionmultiblydoesn't return any value.
0 commit comments