I need help writing a function that returns the length of an array of characters that match "a" || "e" || "i" || "o" || "u".
function getCount(str) {
let count = str.split("").filter((ch) => {
return ch === "a" || "e" || "i" || "o" || "u"
}).length;
return count;
}
console.log(getCount("abracadabra"));
//"a" || "e" || "i" || "o" || "u"
For some reason, it is returning 11, instead of the correct value of 5.
Any help would be appreciated!