title: How to access array from another .js file?
body: <p>I want to get a (Very large) array from another file so it doesn't take up space in my main js file but I cannot figure it out, I have spent about 2 - 3 days searching online but cannot find an answer that will work. I've tried answers from <a href="https://stackoverflow.com/questions/5242050/how-to-access-js-array-defined-in-another-js-file">How to access js array defined in another js file</a> aswell as many other sites but nothing is working.</p>
  <pre><code>// the js file with the array I want
  wordList = [
      &quot;this&quot;,
      &quot;is&quot;,
      &quot;an&quot;,
      &quot;array&quot;
  ]
  </code></pre>
  <pre><code>// main js file
  const word = wordList[Math.floor(Math.random() * wordList.length)];
  </code></pre>
  <p>Any help is appreciated :)
  EDIT: This is for a browser game if that helps</p>