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 +10
-10
lines changed
Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Original file line number Diff line number Diff line change 11// The syntax for this function is valid but it has an error, find it and fix it.
22
33function trimWord ( word ) {
4- return wordtrim ( ) ;
4+ return word . trim ( ) ;
55}
66
77function getWordLength ( word ) {
8- return " word" . length ( )
8+ return word . length ;
99}
1010
1111function multiply ( a , b , c ) {
12- a * b * c ;
13- return ;
12+
13+ return a * b * c ;
1414}
1515
1616/* ======= TESTS - DO NOT MODIFY =====
@@ -22,14 +22,14 @@ To run these tests type `node 2-logic-error` into your terminal
2222function test ( test_name , expr ) {
2323 let status ;
2424 if ( expr ) {
25- status = "PASSED"
25+ status = "PASSED" ;
2626 } else {
27- status = "FAILED"
27+ status = "FAILED" ;
2828 }
2929
30- console . log ( `${ test_name } : ${ status } ` )
30+ console . log ( `${ test_name } : ${ status } ` ) ;
3131}
3232
33- test ( "fixed trimWord function" , trimWord ( " CodeYourFuture " ) === "CodeYourFuture" )
34- test ( "fixed wordLength function" , getWordLength ( "A wild sentence appeared!" ) === 25 )
35- test ( "fixed multiply function" , multiply ( 2 , 3 , 6 ) === 36 )
33+ test ( "fixed trimWord function" , trimWord ( " CodeYourFuture " ) === "CodeYourFuture" ) ;
34+ test ( "fixed wordLength function" , getWordLength ( "A wild sentence appeared!" ) === 25 ) ;
35+ test ( "fixed multiply function" , multiply ( 2 , 3 , 6 ) === 36 ) ;
You can’t perform that action at this time.
0 commit comments