The code solves the whole challenge but the last one whoch is irregular with the task

Tell us what’s happening:
Describe your issue in detail here.

  **Your code so far**

function translatePigLatin(str) {
str.toLowerCase();
const alpha=['q','w','e','r','t','y','u','i','o','p','a','s','d','f','g','h','j','k','l','z','x','c','v','b','n','m'];
const vowels=['a','e','y','o','u'];
for(let i=0;i<str.length;i++){
if (!alpha.includes(str.charAt(i))){return "write in english please"}
if (vowels.includes(str.charAt(0))){
  return str.concat('way');
}
else{
  for (let i=0;i<str.length;i++){
    if(vowels.includes(str.charAt(i))){
          let begin=str.slice(0,i);
  let theRest=str.slice(i);
  return theRest.concat(begin,'ay');
    }
    
  }

}

}
}

translatePigLatin("consonant");
  **Your browser information:**

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.55 Safari/537.36

Challenge: Pig Latin

Link to the challenge:

Why is “i” not included in the vowels? Is that part of the Pig Latin spec?

For the purpose of this challenge, the letter y is not a vowel. You can start by replacing y with i in your vowels array.