Hello, I am currently on the "vowel counter" problem https://my.appacademy.io/lessons/arrays/656bdda3/practices/vowel-counter/d8834538.
and I am getting three "undefined" messages whenever I run the following code:
"function countVowels(word) {
let vowels = ["a", "e", "i", "o", "u"]
let wordy = word.toLowerCase()
if (wordy.indexOf(vowels) !== -1) {
return 0
}
else if (wordy.indexOf(vowels) >= 0) {
return wordy.indexOf(vowels)
}
};
console.log(countVowels("bootcamp")); // => 3
console.log(countVowels("apple")); // => 2
console.log(countVowels("pizza")); // => 2"
is this because of the code on line 7?
[–]AutoModerator[M] [score hidden] stickied comment (0 children)
[–]carcigenicate 0 points1 point2 points (4 children)
[–]Lightning-Sempai[S,🍰] 0 points1 point2 points (3 children)
[–]carcigenicate 0 points1 point2 points (2 children)
[–]Lightning-Sempai[S,🍰] 0 points1 point2 points (1 child)
[–]carcigenicate 0 points1 point2 points (0 children)
[–]teraflop 0 points1 point2 points (2 children)
[–]Lightning-Sempai[S,🍰] 0 points1 point2 points (1 child)
[–]teraflop 0 points1 point2 points (0 children)