Skip to content

Commit aaad927

Browse files
committed
Complete: ironhack-labs#6
1 parent 158aaaf commit aaad927

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/functions-and-arrays.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,19 @@ function uniquifyArray( words ) {
107107
// Iteration #6: Find elements
108108
const wordsFind = ['machine', 'subset', 'trouble', 'starting', 'matter', 'eating', 'truth', 'disobedience'];
109109

110-
function doesWordExist() {}
110+
function doesWordExist( words, search ) {
111+
if ( !words.length ) {
112+
return null
113+
} else {
114+
if ( words.includes(search) ) {
115+
return true;
116+
} else {
117+
return false;
118+
}
119+
}
120+
}
121+
console.log( doesWordExist(wordsFind,"machine") )
122+
console.log( doesWordExist(wordsFind,"machines") )
111123

112124

113125

0 commit comments

Comments
 (0)