const vowelString = 'whatever vowel string';
const count = [...(vowelString.toLowerCase())].map((letter) => [...'aeiou'].includes(letter) ? 1 : 0).reduce((aggr, curr) => aggr + curr);
Hi, i loved this solution. Took me a bit to get my head around the use of reduce here and it's awesome. Thanks. I learned something nice today.
Cool., I didn't know we can use spread on a string. 👍🏻
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.