title: Call JavaScript function from another JavaScript file
body: <pre><code>&lt;html&gt;
  &lt;head&gt;
      &lt;script src=&quot;./first.js&quot;&gt;&lt;/script&gt;
      &lt;script src=&quot;./second.js&quot;&gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;/html&gt;
  </code></pre>
  <p>In the <em>first.js</em> file, I want to call the functions from <em>second.js</em>:</p>
  <pre><code>secondFun(); // calling a function from second.js file
  </code></pre>
  <p>This is second.js file:</p>
  <pre><code>function secondFun() {
      console.log('second function called!!')
  }
  </code></pre>