Answers for "Write a function that takes in a string and then prints out all the vowels in the string. javascript"

0

how to make a vowel counter in javascript

function getCount(str) {
let vowelList = 'AEIOUaeiou'
let vowelsCount = 0;

 for(var i = 0; i < str.length ; i++)
  {
    if (vowelList.indexOf(str[i]) !== -1)
    {
      vowelsCount += 1;
    }
  }
  return vowelsCount;
}
Posted by: Guest on April-05-2020

Code answers related to "Write a function that takes in a string and then prints out all the vowels in the string. javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language