title: Array not returning any value using console log
body: <p>I'm trying to create a program that can shuffle the middle letters (that is, all letters except the first and last letter in the word) within words. I am trying to pull words out of a string, that is pasted into a text area, in my HTML document, and create an array out of them. From there I'll figure out how to somehow make the shuffling works --but for now my problem is as follows:</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>    const text = document.getElementById('textfield');
      const textstring = JSON.stringify(text);
    
          document.querySelector('form.input-form').addEventListener('submit', function (e) {
      
          e.preventDefault();
  
          console.log(text.value);   
  
          var a1 = new Array();
          a1 = textstring.split(' ');
          console.log(a1);
      
      });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>    &lt;!doctype html&gt;
          &lt;html&gt;
              &lt;head&gt; 
                  &lt;title&gt;omrokering af bogstaver&lt;/title&gt;
                  &lt;meta charset="utf-8"&gt;
              &lt;/head&gt;
              &lt;body id="body"&gt;
                  &lt;form class="input-form"&gt;
                      &lt;input id="textfield" type="text" placeholder="Paste text" /&gt;
                      &lt;button type="submit"&gt;omrokér&lt;/button&gt;
                  &lt;/form&gt;
                  
      
                  &lt;script type="text/javascript" src="omrokering.js"&gt;&lt;/script&gt;
              &lt;/body&gt;
          &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>
  <p>I can successfully pull the code out of the form, but when I try to log the contents of the array (I have tried a lot of different ways), it prints this: (1) ['{}'] in the console log, after I've typed in the textarea. When I use this alert function:</p>
  <pre><code>if(textstring !== null){alert(null);}
  </code></pre>
  <p>It returns &quot;null&quot;, so I'm assuming the array is empty, and there is a problem with pulling the string from the form into the array.</p>
  <p>I'm very beginner, so it will be greatly appreciated if you can give me a good explanation for this along with a solution, thank you!</p>