Skip to content

Commit e4ccec3

Browse files
committed
code iteration ironhack-labs#6
1 parent 5ce4f2c commit e4ccec3

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/functions-and-arrays.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,15 @@ uniquifyArray(wordsUnique);
105105
// Iteration #6: Find elements
106106
const wordsFind = ['machine', 'subset', 'trouble', 'starting', 'matter', 'eating', 'truth', 'disobedience'];
107107

108-
function doesWordExist() {}
108+
function doesWordExist(array, newWord){
109+
if (array.includes(newWord)){
110+
return true;
111+
}
112+
else{
113+
return false;
114+
}
115+
}
116+
doesWordExist(wordsFind,'truth');
109117

110118

111119

0 commit comments

Comments
 (0)