title: Why does the switch statement not return information to the app?
body: <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  
    &lt;head&gt;
    &lt;/head&gt;
  
    &lt;body&gt;
      &lt;input type="textArea" id="textSpot"&gt;
      &lt;button onclick="changeHtml()"&gt;Encode!!!&lt;/button&gt;
      &lt;h2 id="afterEncode"&gt;&lt;/h2&gt;
      &lt;script&gt;
      var textSpot = document.getElementById("textSpot").value
  var letters = [text.charAt(0), text.charAt(1), text.charAt(2), text.charAt(3), text.charAt(4), text.charAt(5), text.charAt(6)]
  var i = 0;
  var code = "";
  
  while (i &lt; 10) {
    
      var code = ""
      switch (letters[i]) {
      case "a":
        code += "\"
        break;
  
      case "b":
        code += "^"
        break;
  
      case "c":
        code += "ø"
        break;
  
      case "d":
        code += "˜"
        break;
  
      case "e":
        code += "ˣ"
        break;
  
      case "f":
        code += "Ͱ"
        break;
  
      case "g":
        code += "Є"
        break;
  
      case "h":
        code += " г"
        break;
  
      case "i":
        code += "д"
        break;
  
      case "j":
        code += "ж"
        break;
  
      case "k":
        code += "л"
        break;
  
      case "l":
        code += "ѣ"
        break;
  
      case "m":
        code += "Ѳ"
        break;
  
      case "n":
        code += "҂"
        break;
  
      case "o":
        code += "Ӷ"
        break;
  
      case "p":
        code += "‡"
        break;
  
      case "q":
        code += "⁊"
        break;
  
      case "r":
        code += "※"
        break;
  
      case "s":
        code += "⁀"
        break;
  
      case "t":
        code += "‽"
        break;
  
      case "u":
        code += "₌"
        break;
  
      case "v":
        code += "₱"
        break;
  
      case "w":
        code += "∏"
        break;
  
      case "x":
        code += "≀"
        break;
  
      case "y":
        code += "⌗"
        break;
  
      case "z":
        code += "⌭"
        break;
  
      default:
        console.error("&gt; Unexpected Syntax Error _ (Code: 231815147381181320518)")
    }
    i++
  }
  
  function changeHtml() {
    document.getElementById("afterEncode").innerHTML = ("&lt;h2&gt;" + code + "&lt;/h2&gt;")
  }
  
      &lt;/script&gt;
    &lt;/body&gt;
  
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>
  <p>I don't think anything is wrong with this, so could someone please help me. I am using Chrome, which is one of the most updated browsers, so I think it has to be the code. I'm not very good with code and this was built as a test version for a larger version.</p>