Tell us what’s happening:
Describe tu problema en detalle aquí.
Que esta mal ?
Your code so far
function translatePigLatin(str) {
if (str.match(/^[aeiou]/)){
return str = str + "way";
}
else {
for (let i = 0; i < str[i].length; i++)
if (str[i].match(/^[^aeiou]+/)) {
let resultStr = (str.match(/^[^aeiou]+/g));
const sliceLetter = str.split(resultStr).join('');
const slicStr = sliceLetter + resultStr + "ay";
return slicStr;
}
}
}
translatePigLatin("consonant");
Your browser information:
El agente de usuario es: Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36
Challenge Information:
Programación de algoritmos intermedios - Pig Latin (Latin de los cerdos)