Hello,
I have a problem with my code in the mini linter exercise Step 3.
The exercise step asks for the following:
There is an array of words that are unnecessary. Iterate over your array to filter out these words. Save the remaining words in an array called betterWords. There are several ways that you could achieve this.
and my code to solve it is the following:
const betterWords = storyWords.filter(word => {
for (let i = 0; i < unnecessaryWords.length; i++){
if (word !== unnecessaryWords[i]){
return word;
}
}
})
It seems that there are 188 words in my storyWords array length and 6 words in my unnecessaryWords array length, so my betterWords Array length should be 182 but its 185. As i try log in the console my betterWords array i can still see some of the words that should be filtered out.
I tried some code with the include method too as the hint suggests but the final result is always the same.
Any ideas on what am i missing?