title: How to save an array of strings to a JSON file in Javascript?
body: <p>How can I save an array of strings to a <code>JSON</code> file in <strong>Node.js</strong>:</p>
  <pre class="lang-js prettyprint-override"><code>const alphabet = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'];
  </code></pre>
  <p><em>example.json</em></p>
  <pre class="lang-json prettyprint-override"><code>[
    &quot;a&quot;,
    &quot;b&quot;,
    &quot;c&quot;,
    &quot;d&quot;,
    &quot;e&quot;, 
    &quot;f&quot;,
    &quot;g&quot;,
    &quot;h&quot;
  ]
  </code></pre>