Creating JS functions to use anywhere? Problems with scope and functions being "undefined"
<p>So I'm still quite new to JS, and one of my biggest frustrations is SCOPE.
I have read a lot of guides, and I know when we can and when we can't use certain variables, but I never understand where my mistakes are.
I want to create a bunch of JS functions I can use anywhere in my document, however, I often get the bug that says function is not defined...</p>

<p><strong>My case:</strong>
<br>I add an external script file in the <code>&lt;head&gt;</code>. Inside the script.js I have a function called: launch_ajax.</p>

<pre><code>launch_ajax = function(){
    console.log("fire");
};
window.launch_ajax() = launch_ajax();
</code></pre>

<p>Then at the bottom of my body I have <code>launch_ajax();</code> but is gives me:</p>

<blockquote>
  <p>Uncaught ReferenceError: launch_ajax is not defined</p>
</blockquote>

<p>Please don't scold me for being stupid... =(</p>