Why functions's this keyword is set to window but window does not have function as property
<pre><code>(function() {
  var testFnk = function() {
    console.log(this);
  }

  console.log(window.testFnk);
  testFnk();
})();
</code></pre>

<p>The output of this code is:</p>

<ul>
<li>undefined</li>
<li>Window</li>
</ul>

<p>Can you explain why inside the function this refers to Window, but checking window.testFnk is undefined?</p>

<p>EDIT: As i'm looking at the answers, my question was not stated clearly. What I ment: why in both cases the logged values is either 'undefined' nor 'window'?</p>
