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.  
  11. const x = ' ';
  12. console.log(x.toLowerCase());
  13.  
  14. return str.split('').forEach(function(c) {
  15. console.log(vowelMap[c.toLowerCase()]);
  16.  
  17. c = (c == ' ' || vowelMap[c.toLowerCase()] === undefined) ? c : c + vowelMap[c.toLowerCase()];
  18. console.log(c);
  19. });
  20. }
  21.  
  22.  
  23. const ans = temp("I love water");
  24. console.log(ans);
Success #stdin #stdout 0.03s 17668KB
stdin
Standard input is empty
stdout
 
ishq
Iishq
undefined
 
undefined
l
off
ooff
undefined
v
ex
eex
undefined
 
undefined
w
ant
aant
undefined
t
ex
eex
undefined
r
undefined