fork(1) download
  1. function temp(str) {
  2.  
  3. const vowelMap = {
  4. a: "tiva",
  5. e: "llia",
  6. i: "mus",
  7. o: "phylum",
  8. u: "rea"
  9. };
  10.  
  11.  
  12. return str.split('').map(c => {
  13. (c == ' ' || (vowelMap[c.toLowerCase()] === undefined)) ? ans = c : ans = (c + vowelMap[c.toLowerCase()]);
  14. return ans;
  15. }).join('');
  16. }
  17.  
  18.  
  19. const x = temp("I love water");
  20. console.log(x);
Success #stdin #stdout 0.03s 17448KB
stdin
Standard input is empty
stdout
Imus lophylumvellia wativatelliar