Pig Latin — Should handle words without vowels

I cant understand why it doesn’t pass task “Should handle words without vowels.”

function translatePigLatin(str) {
  let regex = /[eyuioa]/gi;
  if (str[0].match(regex)) {
    return str + 'way';
  else if (str.match(regex) === null) {
    return str + 'ay';
  else {
    do {
      str = str.slice(1) + str[0];
    while (str[0].match(regex) === null);
  return str + 'ay';


Link to the challenge:

“y” is not a vowel.

1 Like

Thank you very much!
‘y’ in the Russian alphabet is vowel so i thought, English ‘y’ is vowel too. :):grin:

It’s a pretty common confusion, especially because we have a multilingual community.