how to make a vowel counter in javascript

JavaScript
const vowelCount = str => {
  let vowels = /[aeiou]/gi;
  let result = str.match(vowels);
  let count = result.length;

  console.log(count);
};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;
}
function countVowels(str) {
  return str.match(/[aeiou]/g).length;
}
Source

Also in JavaScript: