You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
3. Write a function translate() that will translate a text into "rövarspråket". That is, double every consonant and place an occurrence of "o" in between. For example, translate("this is fun") should return the string "tothohisos isos fofunon".
functionisVowel(param,o){varchar=param.split("");for(vari=0;i<char.length;i++){varnewChar,charArr=char[i];if(!(/[aeiou]/i.test(charArr))){if(!(/\s/.test(charArr))){newChar=charArr+o+charArr;}else{newChar=charArr;}}else{newChar=charArr;}// Joining all splited text with code.document.getElementById("text").innerHTML+=newChar;};};isVowel("This is fun",'o')