diff --git a/src/challenges.js b/src/challenges.js index 940a599..d91b221 100644 --- a/src/challenges.js +++ b/src/challenges.js @@ -13,13 +13,38 @@ const repeatedWords = [ "matter" ]; -function howManyTimes() {} - - +function howManyTimes(wordsArray, wordRepeat) { + + let wordTwice = 0; + for (i=0; i duplicateWords.indexOf(string) !== index); + +function uniquifyArray(duplicateWords, duplicates) { + if (duplicateWords.length === 0){ + return null; + } + const filteredArray1 = duplicateWords.filter(function(item1){ + return !duplicates.includes(item1); + }); + return filteredArray1; +} +console.log(uniquifyArray (duplicateWords, duplicates)); // Bonus: Iteration 6 | Product of Adjacent Numbers