Skip to content

Commit 092f412

Browse files
committed
Stelian adds
1 parent c18fad0 commit 092f412

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

src/functions-and-arrays.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,28 @@ function uniquifyArray(wordsUnique){
129129
// Iteration #6: Find elements
130130
const wordsFind = ['machine', 'subset', 'trouble', 'starting', 'matter', 'eating', 'truth', 'disobedience'];
131131

132+
133+
function doesWordExist(arr, singleWord) {
134+
if (arr == 0 ){
135+
return null
136+
137+
}
138+
139+
// if (arr.includes(singleWord)) {
140+
// return true
141+
// } else {return false
142+
// }
143+
144+
return (arr.includes(singleWord))
145+
146+
}
147+
148+
149+
150+
151+
152+
153+
132154
// Iteration #7: Count repetition
133155
const wordsCount = [
134156
'machine',

0 commit comments

Comments
 (0)