File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
Sprint-2/2-mandatory-debug Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change 11// Predict and explain first...
22// =============> write your prediction here
3+ //
34
45function sum ( a , b ) {
56 return ;
@@ -9,5 +10,13 @@ function sum(a, b) {
910console . log ( `The sum of 10 and 32 is ${ sum ( 10 , 32 ) } ` ) ;
1011
1112// =============> write your explanation here
13+ when I run the program it give this output:
14+ The sum of 10 and 32 is undefined
15+
16+ the output is undefiened because the function sum does not return any CSSMathValue . to fix this error we need to change the return statement to return a + b instead of just return .
1217// Finally, correct the code to fix the problem
1318// =============> write your new code here
19+ function sum ( a , b ) {
20+ return a + b ;
21+ }
22+ console . log ( `The sum of 10 and 32 is ${ sum ( 10 , 32 ) } ` ) ;
You can’t perform that action at this time.
0 commit comments