Passing around references in JS inside a function
<p>In the following code, I am passing </p>

<pre><code>(function(Index){
    Index.Index = function(){console.log(23)};

    Index = function(){console.log(123)};


}(Window.Index = Window.Index || {}));    
</code></pre>

<p>Yet the return I am getting is <code>Window.Index={Index:function...}</code></p>

<p>Which logs 23.</p>

<p>I am -trying- to get it to be re-declared as a function. 
eg expected value should be:</p>

<pre><code>Window.Index = function(){console.log(123)};
</code></pre>

<p>What am I doing wrong?</p>
