1const vowelCount = str => {
2 let vowels = /[aeiou]/gi;
3 let result = str.match(vowels);
4 let count = result.length;
5
6 console.log(count);
7};
1function getCount(str) {
2let vowelList = 'AEIOUaeiou'
3let vowelsCount = 0;
4
5 for(var i = 0; i < str.length ; i++)
6 {
7 if (vowelList.indexOf(str[i]) !== -1)
8 {
9 vowelsCount += 1;
10 }
11 }
12 return vowelsCount;
13}
14