Hi all I can’t get “words without vowels” to work. Where is catch? This is what I have now, In IDE it works. Im using for test word “crypt” and return is “crypt”. Is it right or not?
function translatePigLatin(str) {
// let noVowels = str.match(/[^aeiou]/gi)
let vowels = str.match(/^[aeiou]/)
let consonant = str.match(/(\w+?)([aeiou]\w+)/) //?
let cache = []//?
if (vowels) {
// cache.push(vowels[0]);
return str + "way";//?
}
if (consonant) {
cache.push(consonant[1]); //?
return consonant[2] + cache + "ay"; //?
}
// if (noVowels) {
return str//?
// }
}