File tree Expand file tree Collapse file tree
Sprint-2/2-mandatory-debug Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11// Predict and explain first...
22// =============> write your prediction here
3-
3+ // =============explanation==========
4+ // I think will either give error, or no result at all as there is a ";" semicolon after
5+ // the return statement and the actual calculation is not assigned to anything.
46function sum ( a , b ) {
57 return ;
6- a + b ;
8+ a + b ;
79}
810
911console . log ( `The sum of 10 and 32 is ${ sum ( 10 , 32 ) } ` ) ;
1012
1113// =============> write your explanation here
14+ //==============Explanation===============
15+ //To fix the code the ";" must be removed, and the calculation
16+ //needs to be placed next to the "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+
23+ console . log ( `The sum of 10 and 32 is ${ sum ( 10 , 32 ) } ` ) ;
You can’t perform that action at this time.
0 commit comments