I\'m using basic JavaScript to count the number of vowels in a string. The below code works but I would like to have it cleaned up a bit. Would using .includes()
.includes()
One more method (using reduce):
reduce
function getVowels(str) { return Array.from(str).reduce((count, letter) => count + 'aeiou'.includes(letter), 0); }