Advertisement
Shadowhand

Untitled

Aug 28th, 2014
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. var chant = function(text){
  2. var vowels=['a','e','f','h','i','l','n','m','r','s','o','u','x'];
  3. var arr = text.split('');
  4. var output = "";
  5. for(var i = 0; i < arr.length; i++){
  6. var prefix = "a";
  7. if(vowels.indexOf(arr[i])>-1){
  8. prefix += "n";
  9. }
  10. output += "Give me " + prefix + " " + arr[i].toUpperCase() + ". ";
  11. }
  12. return output;
  13. }
  14.  
  15. chant("ugur");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement