This repository was archived by the owner on Oct 26, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change 11// Add comments to explain what this function does. You're meant to use Google!
2- function getNumber ( ) {
2+ function getNumber ( ) { //MAth.random()*10 return random numbers between 1 and 10
33 return Math . random ( ) * 10 ;
44}
55
66// Add comments to explain what this function does. You're meant to use Google!
7- function s ( w1 , w2 ) {
7+ function s ( w1 , w2 ) { //w1.concat(w2) return a new string containing the text of joined string
88 return w1 . concat ( w2 ) ;
99}
1010
1111function concatenate ( firstWord , secondWord , thirdWord ) {
12- // Write the body of this function to concatenate three words together
13- // Look at the test case below to understand what to expect in return
12+
13+ console . log ( firstWord . concat ( " " ) . concat ( secondWord ) . concat ( " " ) . concat ( thirdWord ) ) ;
14+ return firstWord . concat ( " " ) . concat ( secondWord ) . concat ( " " ) . concat ( thirdWord ) ;
1415}
1516
1617/* ======= TESTS - DO NOT MODIFY =====
@@ -34,10 +35,12 @@ test(
3435 "concatenate function - case 1 works" ,
3536 concatenate ( "code" , "your" , "future" ) === "code your future"
3637) ;
38+
3739test (
3840 "concatenate function - case 2 works" ,
3941 concatenate ( "I" , "like" , "pizza" ) === "I like pizza"
4042) ;
43+
4144test (
4245 "concatenate function - case 3 works" ,
4346 concatenate ( "I" , "am" , 13 ) === "I am 13"
You can’t perform that action at this time.
0 commit comments