Write a JavaScript program that returns the number of vowels found within a string.
Code:
function countVowelsInString(str) {
const result = str.match(/[aeiou]/gi);
return result ? result.length : 0;
}
var result = countVowelsInString('helloworld')
console.log(result);