Function Context in Javascript and this Keyword
<p>Could somebody here please get this straight for all of us once and for all?</p>

<pre><code>var parent = {child: function(){
        console.log(this); 
        var log = function(){ 
        console.log(this);}; 
        log();
    }
}
</code></pre>

<p>When I call <code>parent.child()</code>
I get:</p>

<pre><code>Object{}
Window{}
</code></pre>

<p>Other people/ documentation on Mozilla say that this function has been invoked without any context. And </p>

<pre><code>this
</code></pre>

<p>will be the object on which the function is invoked. 
What I don't understand is how on earth this function within another object is considered to be without a context(so <code>this</code> defaulted to the global object). What's the logic here? Thanks</p>