Skip to content

Commit 7ac5982

Browse files
committed
Iteration ironhack-labs#6
1 parent c982bb4 commit 7ac5982

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/functions-and-arrays.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,15 @@ function uniquifyArray(anArr) {
120120
// Iteration #6: Find elements
121121
const wordsFind = ['machine', 'subset', 'trouble', 'starting', 'matter', 'eating', 'truth', 'disobedience'];
122122

123-
function doesWordExist() {}
124-
123+
function doesWordExist(anArr, aString) {
124+
for (let i = 0; i <anArr.length; i++){
125+
let word = anArr[i]
126+
if (word == aString){
127+
return true
128+
}
129+
}
130+
return false
131+
}
125132

126133

127134
// Iteration #7: Count repetition

0 commit comments

Comments
 (0)