title: Convert array to string while preserving the quotes around the elements
body: <p>I have an array, which I want to convert to string while preserving the quotes around the elements.</p>
  <p>For example:</p>
  <pre><code>[&quot;hello&quot;, &quot;there&quot;]
  </code></pre>
  <p>...needs to look like this as a string:</p>
  <pre><code>'&quot;hello&quot;, &quot;there&quot;'
  </code></pre>
  <p>I can do:</p>
  <pre><code>[&quot;hello&quot;, &quot;there&quot;].toString()
  </code></pre>
  <p>But this gives:</p>
  <pre><code>&quot;hello,there&quot;
  </code></pre>
  <p>... which doesn't have quotes around the elements.</p>
  <p>I can do:</p>
  <pre><code>[&quot;hello&quot;, &quot;there&quot;].join('&quot;, &quot;')
  </code></pre>
  <p>... but this gives:</p>
  <pre><code>&quot;hello\&quot;, \&quot;there&quot;
  </code></pre>
  <p>... which has backslashes in the string.</p>
  <p>Also tried replacing those backslashes:</p>
  <pre><code>[&quot;hello&quot;, &quot;there&quot;].join('&quot;, &quot;').replace(/\\/, &quot;&quot;);
  </code></pre>
  <p>...but the backslashes remain:</p>
  <pre><code>&quot;hello\&quot;, \&quot;there&quot;
  </code></pre>
  <p>Finally, we can attempt JSON.stringify:</p>
  <pre><code>JSON.stringify([&quot;hello&quot;, &quot;there&quot;])
  </code></pre>
  <p>... only to get:</p>
  <pre><code>&quot;[\&quot;hello\&quot;,\&quot;there\&quot;]&quot;
  </code></pre>
  <p>Alas, is there no solution to such misguided efforts?</p>