Mini linter - delete every other overused word

Hi guys

Please can someone help

I’ve been trying to figure this out for like 5 or 6 days now and it’s driving me mad

I want to do the first additional task of this project, which is to delete every other word of the overused words

I’ve had many different ideas and seen so many different methods but I can’t seem to grasp how to apply any method to my current code

Any help would be so appreciated!

Thank you!

/ Step 2
// console.log(storyWords.length)

function isEven(value) {
if (value % 2 == 0) {
return true;
} else{
return false;
}
}

// Step 3
let betterWords = storyWords.filter(function(word){
return !unnecessaryWords.includes(word)
})

// console.log(betterWords)

//Step 4

let reallyCount = 0
let veryCount = 0
let basicallyCount = 0

for (const word of betterWords) {
if (word === ‘really’){
reallyCount += 1
} else if (word === ‘very’){
veryCount += 1
} else if (word === ‘basically’){
basicallyCount += 1
}
}

// console.log('Really: ', reallyCount)
//console.log('Very: ', veryCount)
//console.log('Basically: ', basicallyCount)

// Step 8

//I copied and pasted this from a random website but don’t know if this is the way to go here
function getAllIndexes(betterWords, really) {
var indexes = , i;
for (i = 0; i < betterWords.length; i++)
if (betterWords[i] === val)
indexes.push(i);
return indexes;
}

//Step 5
let sentenceCount = 0

for (words of storyWords) {
// console.log(words[words.length - 1]) //This gives index position of last letter
if (words[words.length - 1] === ‘.’){
sentenceCount += 1
} else if (words[words.length - 1] === ‘!’) {
sentenceCount += 1
}
}

//Step 6
const allLogs = () => {
console.log(sentenceCount);
console.log(storyWords.length);
console.log(reallyCount + veryCount + basicallyCount)
}

// Step 7
// console.log(betterWords.join(’ '))

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.