Pig latin challenge

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

return pigLatin;
}

translatePigLatin(“consonant”);

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

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

Thank you very much. Really do appreciate it.