Hi i want to compare a string to an array; then create a new array which excludes the matching items from the 2 previously compared data. I know how to do this using .filter() and .includes() but codecademy says that are 7 different ways to accomplish this, can people explain to me the other ways.
let story = ‘Last weekend, I took literally the most beautiful bike ride of my life. The route is called “The 9W to Nyack” and it actually stretches all the way from Riverside Park in Manhattan to South Nyack, New Jersey. It’s really an adventure from beginning to end! It is a 48 mile loop and it basically took me an entire day.’ ;
let overusedWords = [‘really’, ‘very’, ‘basically’];
const storyWords = story.split(’ ')
Question: 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.