Reusable function from an external script
<p>Simplified Example:</p>

<pre><code>// path/to/js/panel.js
$(function(){
    var hidePanel = function(){
        //hides the panel div
    };
});

// path/to/js/another-script.js
$(function(){
    hidePanel(); //out of scope MEGA-FAIL
});
</code></pre>

<p>As we speak, i have some functions/variables copy-pasted in 2 different files.
I was curious whether RequireJS would solve this problem...</p>
