lundi 8 mai 2017

Having problems with my function it has to be able to except a accepts a character ch (i.e., a string of length one) and returns true if ch is a vowel

function isVowelR(ch,pattern){
var ch = "a";
var pattern =/a|e|i|o|u|y/i ;
}
if(pattern.test(ch)){
return true;        
}
else{return false}

I got an error saying that there was an illegal return statement, I also have to keep it as a function with an if else statement.

Aucun commentaire:

Enregistrer un commentaire