File tree Expand file tree Collapse file tree 2 files changed +15
-11
lines changed
Expand file tree Collapse file tree 2 files changed +15
-11
lines changed Original file line number Diff line number Diff line change @@ -17,9 +17,10 @@ console.log(`The result of multiplying 10 and 32 is ${multiply(10, 32)}`);
1717// Finally, correct the code to fix the problem
1818// =============> to use the function that gives a result need to use RETURN not consol.log inside the function
1919
20- function multiply ( a , b ) {
21- const forAllMutiply = ( a * b ) ;
22- return forAllMutiply ; //return can be use for diferents values/results
20+ function multiply ( num1 , num2 ) {
21+ // const forAllMutiply = (a * b);
22+ // return forAllMutiply; //return can be use for diferents values/results
23+ return num1 * num2 ;
2324}
2425
2526console . log ( `The result of multiplying 10 and 32 is ${ multiply ( 10 , 32 ) } ` ) ;
Original file line number Diff line number Diff line change 2323
2424
2525
26- function takeSapcestoUpercase ( textSnake ) {
27-
28- let takespace = textExemple . split ( " " ) ; // returns array nned to tranform to string again before upercase
29- let transfStringAgain = takespace . join ( "_" ) ;
30- let changeUper = transfStringAgain . toUpperCase ( 1 ) ;
31- return changeUper ;
26+ function takeSapcestoUpercase ( inputString ) {
27+
28+ let takespace = inputString . split ( " " ) ;
29+ let transfStringAgain = takespace . join ( "_" ) ;
30+ let changeUper = transfStringAgain . toUpperCase ( ) ;
31+ return changeUper ;
3232} ;
33- let textExemple = "hello there" ;
34- console . log ( takeSapcestoUpercase ( textExemple ) ) ;
33+ let textExemple = "cat dog rabbit" ;
34+ console . log ( takeSapcestoUpercase ( textExemple ) ) ;
35+
36+ let textExemple2 = "hello there" ;
37+ console . log ( takeSapcestoUpercase ( textExemple2 ) ) ;
You can’t perform that action at this time.
0 commit comments