Pig Latin plz help why the code did'nt meet all the require

Tell us what’s happening:

Your code so far

function translatePigLatin(str) {
  let regx1=/^[aeouiy]/i;
  let regx2=/^[^aeouiy]{2}/;
  return str.concat("way").toLowerCase();
}else if(regx2.test(str)){
  return str.replace(regx2,"").concat(str.slice(0,2),"ay")

  return str.replace(/^[^aeouiy]/,"").concat(str.slice(0,1),"ay")


Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 5.1; rv:52.0) Gecko/20100101 Firefox/52.0.

Link to the challenge:

In the English language, y is not considered a vowel.