Pig Latin Simple Problem

why will this not return" eightway".
Can’t seem to see much wrong.


function translatePigLatin(str) {
  var vowel = /[aioue]/;
  var suffix = "way";
  if(str.charAt(0)==vowel){
    var str2 = str+suffix;
    console.log(suffix);
    return str2;
  }
 
}
 
translatePigLatin("eight");

Thanks!This seems to work,could I use the match method as well as the test one.

function translatePigLatin(str) {
  var vowel = /[aioue.]/;
  var suffix = "way";
  if(vowel.test(str)){
    var str2 = str+suffix;
    console.log(suffix);
    return str2;
  }
 
}
 
translatePigLatin("eight");