Build a Sentence Analyzer - Step 1

Tell us what’s happening:

I’ve been doing this exercise for long time, and still I got struggled. Some suggestion to look at or notice it, will be good.

Your code so far

// User Editable Region




function getVowelCount(sentence){
  const vowels = 'aeiou'
  var c = 0
  var total = 0 

  for(let s of sentence){
    if(vowels.includes(s)){
      c++
      total += c
    }
    return c
  }
}


getVowelCount('hello')
// User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:153.0) Gecko/20100101 Firefox/153.0

Challenge Information:

Build a Sentence Analyzer - Step 1

GitHub Link: freeCodeCamp/curriculum/challenges/english/blocks/workshop-sentence-analyzer/66e2d680e129e1423116a541.md at main · freeCodeCamp/freeCodeCamp · GitHub

Hi @edgshift

To help you debug, try adding the following console log:

console.log(getVowelCount('"Apples are tasty fruits"')) // 7

Happy coding