Project: Mini Linter Step 8

Hi, I have been working on the 3 ideas suggested in the step 8 to extend the project. I have accomplished the ideas 1 & 3 , but the idea 2 it’s giving me nightmares. If someone could help me finding a way to accomplish this task I will appreciate it. Here I leave how I solved the ideas 1 & 3 in case someone its stuck in these points.

let overUsedReallyCount = 0;
let overUsedVeryCount = 0;
let overUsedBasicallyCount = 0;
let newText = [];

for (const word of betterWords){
  switch (word){
    case 'really':
    overUsedReallyCount += 1
    break;
    case 'very':
    overUsedVeryCount += 1
    break;
    case 'basically':
    overUsedBasicallyCount += 1
    break;
  }

  if (overUsedVeryCount === 2){
    overUsedVeryCount = 0;
    newText.push('JAJAJA');
    continue;
  } else if (overUsedReallyCount === 2){
    overUsedReallyCount = 0;
    newText.push('JAJAJA');
    continue;
  } else if (overUsedBasicallyCount === 2){
    overUsedBasicallyCount = 0;
    newText.push('JAJAJA');
    continue;
  } else {
    newText.push(word);
  }
  
};

console.log(newText.join(' '));
1 Like

Hey digital5236246930!
If you share the exercise or some code with your doubts we can talk it through and maybe find a solution together :slight_smile: