Point three (unnecessary words) with a nested loop instead of .filter()

Hello there, I’m trying to solve the third point (remove the unnecessary words) with a nested for loop instead of using filter() but the result is always an empty array. I guess my loop doesn’t run properly but I cannot figure out why.
Thanks a lot

Hey @blogwhiz81431, welcome to the forums!

You misspelled length here:

for (let j = 0; j < unnecessaryWords.lenght; j++) {

Can you also send the link to the exercise?

Hi @stevencopeland, thank you for your reply!!

Here’s the link to the exercise:

https://www.codecademy.com/paths/web-development/tracks/web-dev-js-arrays-loops-objects/modules/learn-javascript-iterators/projects/mini-linter

If I’m running your code correctly, you’re still having trouble with this right?

I get this when I run your code now:

[ 'Last',
  'Last',
  'Last',
  'weekend,',
  'weekend,',
  'weekend,',
  'I',
  'I',
  'I',
  'took',
  'took',
  'took',
  'literally',
  'literally',
  'the',
  'the',
  'the',
  'most',
  'most',
  'most',
  'beautiful',
  'beautiful',
  'beautiful',

As you can see, three of each word is printed out, except the overused words. This means that yes! The program is working! But, unfortunately, due to the nesting of the loop, it pushes each word three times to the array.