Pig latin challenge

Pig latin challenge
0.0 0


function translatePigLatin(str) {
let pigLatin = ‘’;
pigLatin = str + ‘way’;
pigLatin = str.replace(/(^[^aeoiu]+)(\w+)/g, ‘$2$1ay’);

return pigLatin;


why is the above code not working? The console returns “should handle words without vowels”


What would you solution return for the word “TV”?


The challenge does not specify. Can I make it anything?


The challenge instructions state:

Pig Latin takes the first consonant (or consonant cluster) of an English word, moves it to the end of the word and suffixes an “ay”.

With a word like “TV”, if you move the letters “TV” to the end (technically no movement needed) and add “ay”, it would become “TVay”.


Thank you very much. Really do appreciate it.


Another example of a word without vowels would be “rhythm” which would become “rhythmay”