As I personally don’t know any programmers or devs, may I ask the good people of this forum to check out my algorithm and let me know what you think, It works, and I know there’s a one liner somewhere out there for this, but is mine looking anything like a pro would write? Even a bit of it?
I did some googling for this, the logic is mine - some of the syntax and the test method was looked up as I worked.
If this is now in the wrong forum - mods, feel free to move.
[spoiler]
function translatePigLatin(str) {
if(/[aeiou]/.test(str[0]) === true){
str = str + "way";
}else{
while (/[aeiou]/.test(str[0]) === false){
str = str.split("");
var letter = str.shift();
str.push(letter);
str = str.join("");
}
str = str + "ay";
}
return str;
}
repl, commented[/spoiler]