How to Translate english words to pig latin Using Javascript?
<p>I'm in a beginning computer science class and I'd really like help on my current assignment. The assignment is to make a program that translates english words into pig latin. It gets input from the user and then spits out the translated string. For example, if you input "hello world", the output should be "ellohay orldway". If the first letter of the word is a vowel, however, it just adds "ay" to the end and does not bring the first letter to the back.
The requirement of the assignment is that I have to use two functions in my code. Here is the code I have so far. Sorry it is not very complete.</p>

<p>Would anyone be kind enough to let me know what the next step is?</p>

<pre><code>var wordInput = prompt("Please enter a word to be translated into pig latin.").toLowerCase();

var myArray = wordInput.split(" ");

var vowel = function(word){
    switch (word.charAt(0)) {
  case 'a':
    return true;
    break;
  case 'e':
    return true;
    break;
  case 'i':
    return true;
    break;
  case 'o':
    return true;
    break;
  case 'u':
    return true;
    break;
  default:
    return false;
    break;

alert(wordInput + "ay")
}
}

var convertWord = function(word){
    return wordInput.substring(1) + wordInput.substring(0,1);
}


convertWord();

var res = wordInput.charAt(0)
</code></pre>