We're a place where coders share, stay up-to-date and grow their careers.
this function is counting all alphabets in string.
you right!
to work with vowels need filter before this process:
const countChars = (coll, chr) => coll[chr] ? {...coll, [chr]: coll[chr] + 1} : {...coll, [chr]:1 }; const vowels = "aeiouóöőüúűáé"; // hungarian vowels included const filterWovels = chr => vowels.indexOf(chr) > -1; const vowelCount = s => [...s.toLowerCase].filter(filterWovels).reduce(countChars, {});
this function is counting all alphabets in string.
you right!
to work with vowels need filter before this process: