title: js decoding morse code
body: <p>For this project, I am trying to decode a given Morse code string. Encoded characters are separated by a single space and words are separated by three spaces. I am having a tough time getting past the word spaces. I keep getting "wordundefinedword". </p>
  
  <pre><code>decodeMorse = function(morseCode) {
      outPut = "";
  
      for (var i = 0; i &lt; morseCode.split(" ").length; i++) {
          if (i === "   ") {
              outPut += " ";
          } else {
              outPut += MORSE_CODE[morseCode.split(" ")[i]];
          }
  
      }
      return outPut;
  }
  </code></pre>
  
  <p>Example: "".... . -.--"   "-- .- -."" -> "HEY MAN"
  Sorry for the weird quotes. It wouldn't show the spaces without the outer ones.</p>