title: javascript - Convert array to string while preserving brackets
body: <p>I have a multidimensional array that looks like this:</p>
  
  <pre><code>var myArray =[[1,2,3,4,5], 
                [1,2,3,4,5], 
                [1,2,3,4,5], 
                [1,2,3,4,5]];
  </code></pre>
  
  <p>I wish to put its contents in a div (so that one can easily copy and paste).</p>
  
  <p>However, when I do</p>
  
  <pre><code>var x = document.getElementById("result");
  x.textContent = myArray;
  </code></pre>
  
  <p>I just get</p>
  
  <pre><code>1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5
  </code></pre>