title: Using JavaScript to encode morsecode
body: <p>I'm trying to convert any text string into Morse Code in the simplest way possible. I am very new to programming so please can you give me some advice on what methods i could use.</p>
  
  <p>I have so far just written a phrase(string) and an Array holding the Morse Code but i am struggling on what steps to use next on how to take each character of the string then checking it with the array and printing out the Morse Code equivalent of the string.</p>
  
  <pre><code>var phrase = "go down like a lead balloon";
  
  var morseCode = [".-", "-...", "-.-.", "-..", ".", "..-.", "--.", "....", "..", ".---", "-.-",     ".-..", "--", "-.", "---", ".--.", "--.-", ".-.", "...", "-", "..-", "...-", ".--", "-..-", "-.--", "--.."]
  
  for(i=0; i&lt;phrase.length; i++){
  
  c = phrase.charAt(i);
  
  WScript.echo(c + " | " + i);
  }  
  </code></pre>