fork(1) download
  1. function temp(str) {
  2.  
  3. const vowelMap = {
  4. a: "ant",
  5. e: "ex",
  6. i: "ishq",
  7. o: "off",
  8. u: "ufo"
  9. };
  10. return str.split('').forEach(function(c) {
  11. c = (vowelMap[c] === undefined) ? c : c + vowelMap[c];
  12. });
  13. }
  14.  
  15.  
  16. const ans = temp("I love water");
  17. console.log(ans);
Success #stdin #stdout 0.02s 17388KB
stdin
Standard input is empty
stdout
undefined