Hi everyone,
I am trying to write a vowel count function, but I don’t understand what is being logged to the console when I test it (several lines with the last line being the correct number). I also don’t understand what the grey circle with the white number to the left of the output in VS code means.
The correct number does appear in the last line of the console, but I am not sure what the rest means when I try to test the function in VS code. Ultimately, it is not returning the correct vowel count anyway and I am trying to figure out what is going on if someone can help please?
function getCount(str) {
let tempArray = str.split("");
let vowelCount = 0;
for (let i = 0; i <= tempArray.length; i++) {
if (
tempArray[i] == "a" ||
tempArray[i] == "e" ||
tempArray[i] == "i" ||
tempArray[i] == "o" ||
tempArray[i] == "u"
) {
vowelCount++;
}
return vowelCount;
}
}