title: Is it best practice to define global JavaScript objects in HTML?
body: <p>I have a web project that has the following lines of code in it</p>
  
  <pre><code>&lt;script&gt;var obj = {...}&lt;/script&gt;
  &lt;script src='./app.js'&gt;&lt;/script&gt;
  </code></pre>
  
  <p><code>./app.js</code> loaded by the second script tag uses <code>obj</code> defined by the first script tag. You could say that <code>obj</code> is a global variable to <code>./app.js</code>.</p>
  
  <p>I don't want to define <code>obj</code> inside <code>./app.js</code> because it's a very large object but is this bad practice to define global variables like this?</p>