Tell us what’s happening:
Hi guys, I see that the recommended solutions are using regex, why won’t my code below work? It seem to be identifying and changing the words that begin with a consonant, but other words that start with a vowel it doesn’t work for. Any feedback would be much appreciated. Thanks!
**Your code so far**
function translatePigLatin(str) {
let start = str[0];
let noCons = str.slice(1,);
let result = "";
//console.log()
if (start = "a"||"e"||"i"||"o"||"u") {
return result = str + "way";
} else result = noCons + start + "ay";
}
translatePigLatin("consonant");
**Your browser information:**
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:81.0) Gecko/20100101 Firefox/81.0
Challenge: Pig Latin
Link to the challenge: