|
Hi I've just started to learn JavaScript and thought I was doing okay but I'm totally stumped at the moment. I would be grateful for any help provided on the following:
I've added the followng function (isVowel) to a function library and have to create a new function called dropVowel, which makes use of this function.
I have to declare a variable called resultString and assign it to an ampty string, then use a for statement to access each character of the string in turn. Within the for statement I need to add an if statement to check if the current character is a vowel. If not a vowel, it is to be added to the varaible resultString.
function isVowel(aCharacter)
{
return ((aCharacter == 'a') || (aCharacter == 'A')||
(aCharacter == 'e') || (aCharacter == 'E')||
(aCharacter == 'i') || (aCharacter == 'I')||
(aCharacter == 'o') || (aCharacter == 'O')||
(aCharacter == 'u') || (aCharacter == 'U'))
}
I've read and re-read the instructions but just can't seem to make any headway. My brains turned to musg becasue I am trying to pack up smoking, so thats my excuse lol.
Thanks for your help!!
Regards
Sue
|
|
|
Wow I finally managed to write the function and get it working - I was missing the ! operator. It feels great to have worked it out :)
|
|
|
|
|
|
|
|