constcharCounter=({strToCount="",chars=""}={})=>{constcharsToCount=chars.toLowerCase();returnArray.from(strToCount.toLowerCase()).reduce((acc,candidate)=>acc+=charsToCount.includes(candidate)?1:0,0)}constcountVowels=strToCount=>charCounter({strToCount,chars:"aeiou"});assert(countVowels("The quick brown fox jumps over the lazy dog.")===11);assert(countVowels("Hello")===2);assert(countVowels("Xyl")===0);assert(countVowels("aeiouAEIOU")===10);
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Discussion on: Daily Challenge #3 - Vowel Counter
For further actions, you may consider blocking this person and/or reporting abuse