Alright I cant seem to get this to work. I have one function written so far. It works great. Now I need to get my new function to call the second function.
Here is the first function:
function isVowelR(str) {
if(str = str.match(/[aeiou]/gi))
return true
else
return false
}
This one works fine. Returns true if str is a vowel. Here is the one Im stuck on though. This is what Ive tried (as well as some other stuff.
function countVowels(str) {
var count = 0
for (var i = 0; i == str.length; i++)
{
if (i == isVowelR(i))
{
++count
}
}
return count
}
This second function needs count how many vowels are in the string that is entered (which I figured out in a different function). But how do I get it to work if I am required to call the first function?
str[i], notialone since that is the index and not the vowel.