function translatePigLatin(str) {
let myRegex = /^[aeiou]/;
var result = myRegex.test(str);
if (result==true){
str+='way'
}else{
if (str.substring(1,2)=="a"){
str=str.substring(1,)+str.substring(0,2)+"y";
}else{
str=str.substring(2,)+str.substring(0,2)+"ay";
}
}
console.log(str);
return str;
}
translatePigLatin("california");
I do not understand what else is needed?