View Single Post
Old 11-12-2012, 04:24 PM   PM User | #4
devnull69
Senior Coder

 
Join Date: Dec 2010
Posts: 2,261
Thanks: 10
Thanked 533 Times in 527 Posts
devnull69 will become famous soon enough
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
}

Last edited by devnull69; 11-12-2012 at 04:26 PM..
devnull69 is offline   Reply With Quote