While I was working with the PigLatin code, suddenly page got stuck and unable to access any of the option, go forward/backward topics etc.
Here is my PigLatin code which made the page stuck with.
function translatePigLatin(str)
{
if(!isConsonent(str.charAt(0)))
str.concat(“way”);
else
{
strarr=str.split("");
while(isConsonent(str[0])))
{
st=strarr.slice(1);
strarr.push(st);
}
strarr.join("");
strarr.concat(“ay”);
}
function isConsonent(char)
{
return ![aeiou]/.test(char);
}
return str;
}
translatePigLatin(“consonent”);