title: Should I use 'import and export' for a simple project?
body: <p>I think I have some misunderstanding of 'import and export'.</p>
  <p>There are many modules, eg: React, react-router-dom, etc...</p>
  <p>However, I'd like to talk about the simple project, only html, css and Javascript, without nodeJs/ React.</p>
  <p>If I spilt my js file in 5 parts...</p>
  <p>Method 1: link js directly</p>
  <pre><code>&lt;script src=&quot;javascript1.js&quot;&gt;&lt;/script&gt;
  &lt;script src=&quot;javascript2.js&quot;&gt;&lt;/script&gt;
  &lt;script src=&quot;javascript3.js&quot;&gt;&lt;/script&gt;
  &lt;script src=&quot;javascript4.js&quot;&gt;&lt;/script&gt;
  &lt;script src=&quot;javascript5.js&quot;&gt;&lt;/script&gt;
  </code></pre>
  <p>Method 2:
  Import function from js 2,3,4,5</p>
  <pre><code>&lt;script type=&quot;module&quot; src=&quot;Main.js&quot;&gt;&lt;/script&gt;
  &lt;script src=&quot;javascript2.js&quot;&gt;&lt;/script&gt;
  &lt;script src=&quot;javascript3.js&quot;&gt;&lt;/script&gt;
  &lt;script src=&quot;javascript4.js&quot;&gt;&lt;/script&gt;
  &lt;script src=&quot;javascript5.js&quot;&gt;&lt;/script&gt;
  </code></pre>
  <p>I tried the method 2 and I found it's break.</p>
  <p>As there are many global variables in my project...</p>
  <p>Finally, it shows error / some variable not found during import the function from other js.</p>
  <p>Is there any pros of using 'import and export' for a simple project?</p>
  <p>or</p>
  <p>just use method 1, link the js file directly.</p>