title: Export array to be used in another javascript file
body: <p>In my post request, I want to check if <code>thisString</code> exists in another javascript file array. </p>
  
  <p>Array.js</p>
  
  <pre><code>exports.names = [
      'John',
      'Mary'
  ]
  </code></pre>
  
  <p>Main.js</p>
  
  <pre><code>if (names.includes(thisString)) {
      ...do stuff...
  }
  </code></pre>
  
  <p>if <code>thisString = Mary</code>, <code>Main.js</code> returns "undefined". If I <code>console.log(names)</code> it returns the array. But <code>console.log(names[0])</code> is undefined. And If I copy and paste the array into the <code>Main.js</code> file it works as intended.</p>
  
  <p>I want to have the array in another file just to clean things up a bit. But what am I doing wrong?</p>