Hello guys i really dont know what to do now, it asks mme to use the bracket notation, but when i use the ++ the result is correct. What should i do
Your code so far
function getVowelCount(sentence) {
const vowels = "aeiou";
let count = 0;
for (const char of sentence.toLowerCase()) {
if (vowels.includes(char)) {
count++;
}
}
// User Editable Region
return count;
}
let vowelCount = getVowelCount("Apples are tasty fruits");
console.log("Vowel Count: ${vowelCount}")
// 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/138.0.0.0 Safari/537.36
Your punctuation / lack of is not the same as in the instructions. You need to have everything inside the grey shaded area.
Try it without template literals if it still doesn’t work. When I test your code it is telling me your quotes are back ticks are unexpected characters so I need to change them to make it pass. That might just be me. Still need to sort the text itself though
I’ve edited your post to improve the readability of the code. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.
You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.