Javascript Modules
<p>I have the following code. It's a JavaScript module.</p>

<pre><code>(function() {

   // Object
   var Cahootsy;

   Cahootsy = {
       hello: function () {
           alert('test');
       },
    };

    (Cahootsy.scope = (function() {
        return this;
     })()).Cahootsy = Cahootsy;

    return Cahootsy;

}).call(this);
</code></pre>

<p>I don't understand the section:    </p>

<pre><code>    (Cahootsy.scope = (function() {
        return this;
     })()).Cahootsy = Cahootsy;
</code></pre>

<p>I think it is creating an object referencing 'this' module and then assigns the Cahootsy variable to a global Cahootsy variable. What I don't understand is why 'this' needs to be assigned to Cahootsy.scope</p>
