I'm just getting into javascript callbacks, trying to implement an easy vowel counting function. This is what I have, but I can not figure out what is syntactically wrong with this callback. I'm sure this is a very obvious error, but if anybody could enlighten me, that would be great.
function isitVowel(letter){
return letter in ['a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U'];
}
function countVowels(line){
return line.split(",").filter(isitVowel).length;
}
countVowels("a,b,c,d,e");