Hm ... there are several things that make me think that you are still in a very basic learning phase.
- vocals is a function. To call the function, you need parentheses ()
vocals(). To compare the result of a function to some other value, you must return something from the function
- What exactly do you want to achieve? Remove the vocals? So you want to find out if name[i] is a vocal?
Code:
function vocal(character) {
var returnValue = false;
if(character == "a" || character == "i" || character == "e" || character == "o" || character == "u")
returnValue = true;
return returnValue;
}
...
if(!vocal(name[i])) {
// here the current character is not a vocal
}