Grammar Checker Project - Question about the additional improvements for "Removing the word “very”."

Hi! I’m working on the Grammer Checker project and I’m stuck on one of the practices after you complete the project. It’s the first time I’m completely on my own and I can’t quite get it.

Here’s a link to the project since this is asking me to add it: https://www.codecademy.com/courses/introduction-to-javascript/projects/mini-linter

This is the code that I have so far for removing the word “very”:

//REMOVE THE WORD VERY
let remove = 'very';

//get index of very's and then remove them with splice!

let veryIndex = storyWords.findIndex((word) => {
  return word === remove;
});
console.log(veryIndex + ' is very index');

storyWords.splice (storyWords.indexOf(veryIndex), 2)

Any thoughts on how it could be done?

Thanks so much!
Kevin

Ok I’ve made progress!

I can’t use splice because it can only remove 1 or multiple items in a row. So I got close with filter! I have a new array with very removed, but now I need to able to call the original array, and have them removed. “console.log(storyWords.join(’ '));”. Or maybe that doesn’t matter at this point since I have the new array that I can use that has the words removed?

const removeVery = storyWords.filter((word) => word !== 'very');

console.log(removeVery.join(' '));

Thanks! :smiley:
Kev