Build a Sentence Analyzer - Step 1

Tell us what’s happening:

Why does this work in code.io and not here? Come on! :heart: It says none of my code is correct!

Your code so far


// User Editable Region

function getVowelCount(sentence){
 }
 const vowels = "aeiouAEIOU"
 let count = 0
 for (let char of sentence){
   if (vowels.includes(char)) {
     count++
   }
 }

  return count;
}
 console.log(getVowelCount("Apples are tasty fruits"));
 console.log(getVowelCount("Hello World"));
 

// User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36 Edg/136.0.0.0

Challenge Information:

Build a Sentence Analyzer - Step 1

I can’t imagine how this incorrect syntax could work in code.io.

1 Like