Mini Linter Step 3


#1

Hi. Im stuck in step 3. I have this code

let betterWords = storyWords.filter(word => !unnecessaryWords.includes(word));

When i console.log betterWords i keep seeing the unnecesaryWords.

I thought that filter would remove it.
Any ideas?
Thank you


#2

given i wasn’t provided all the code, i had to implement it within my program, which i did:

[ 'Last',
  'weekend,',
  'I',
  'took',
  'the',
  'most',
  'beautiful',
  'bike',
  'ride',
  'of',
  'my',
  'life.',

it seems literally has successfully been removed. Unless you provide me with the full code to ensure no differences, it seems fine

project url for quick access


#3
let overusedWords = ['really', 'very', 'basically'];

let unnecessaryWords = ['extremely', 'literally', 'actually' ];

let storyWords = story.split('');
console.log(storyWords.length);

let betterWords = storyWords.filter(word => !unnecessaryWords.includes(word));

console.log(betterWords);

#4

see, that explains the problem (and why you should always include the full code)

log storyWords:

let storyWords = story.split('');
console.log(storyWords);

you cut each individual letter/character, which means your filter will never work, given a single character can’t equal words consisting of multiple characters (like extremely)


#5

Yess!! Thank you! Thats right! I willpost all the code next time.


#6