Advertisement
Shadowhand

Give me an A.

Aug 27th, 2014
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement