File tree Expand file tree Collapse file tree 1 file changed +13
-5
lines changed
Sprint-2/2-mandatory-debug Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change 11// Predict and explain first...
22// =============> write your prediction here
3+ // PREDICTION: The function will not return the sum because the return statement is placed before the actual addition operation.
34
4- function sum ( a , b ) {
5- return ;
6- a + b ;
7- }
5+ // function sum(a, b) {
6+ // return;
7+ // a + b;
8+ // }
89
9- console . log ( `The sum of 10 and 32 is ${ sum ( 10 , 32 ) } ` ) ;
10+ // console.log(`The sum of 10 and 32 is ${sum(10, 32)}`);
1011
1112// =============> write your explanation here
13+ // The return statement is placed before the addition operation, so the function will return undefined instead of the sum.
14+
1215// Finally, correct the code to fix the problem
1316// =============> write your new code here
17+ function sum ( a , b ) {
18+ return a + b ;
19+ }
20+
21+ console . log ( `The sum of 10 and 32 is ${ sum ( 10 , 32 ) } ` ) ;
You can’t perform that action at this time.
0 commit comments