11// Add comments to explain what this function does. You're meant to use Google!
22function getNumber ( ) {
3- return Math . random ( ) * 10 ;
3+ return Math . random ( ) * 10 ;
44}
55
66// Add comments to explain what this function does. You're meant to use Google!
77function s ( w1 , w2 ) {
8- return w1 . concat ( w2 ) ;
8+ 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+ // 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
1414}
1515
16- /* ======= TESTS - DO NOT MODIFY ===== */
16+ /* ======= TESTS - DO NOT MODIFY =====
17+ There are some Tests in this file that will help you work out if your code is working.
18+
19+ To run these tests type `node 3-function-output` into your terminal
20+ */
1721
1822function test ( test_name , expr ) {
19- let status ;
20- if ( expr ) {
21- status = "PASSED"
22- } else {
23- status = "FAILED"
24- }
25-
26- console . log ( `${ test_name } : ${ status } ` )
23+ let status ;
24+ if ( expr ) {
25+ status = "PASSED" ;
26+ } else {
27+ status = "FAILED" ;
28+ }
29+
30+ console . log ( `${ test_name } : ${ status } ` ) ;
2731}
28-
29- test ( "concatenate function - case 1 works" , concatenate ( 'code' , 'your' , 'future' ) === "code your future" )
30- test ( "concatenate function - case 2 works" , concatenate ( 'I' , 'like' , 'pizza' ) === "I like pizza" )
31- test ( "concatenate function - case 3 works" , concatenate ( 'I' , 'am' , 13 ) === "I am 13" )
32+
33+ test (
34+ "concatenate function - case 1 works" ,
35+ concatenate ( "code" , "your" , "future" ) === "code your future"
36+ ) ;
37+ test (
38+ "concatenate function - case 2 works" ,
39+ concatenate ( "I" , "like" , "pizza" ) === "I like pizza"
40+ ) ;
41+ test (
42+ "concatenate function - case 3 works" ,
43+ concatenate ( "I" , "am" , 13 ) === "I am 13"
44+ ) ;
0 commit comments