Vowel Count Problem

const sentence = ' Hello this is my first problem in ds this year ';

const vowelCounter = (stringInput) => {
  const vowels = ['a', 'e', 'i', 'o', 'u'];
  return stringInput.split('').filter((char) => vowels.includes(char)).length;
};

vowelCounter(sentence);

Posted Apr 9, 2025, 8:26 PM UTC

10
Loading comments…