title: "this" refers to window when called inside a private function
body: <p>I'm still wrapping my head around "this". Here I use "this" inside of a function <code>sayFoo</code>. </p>
  
  <p>I'm surprised that "this" is the window, when I log it from inside sayFoo().</p>
  
  <p>What am I not understanding here about context?</p>
  
  <pre><code>myCoolThing = {
    foo: "1",
    doSomething: function() {
      sayFoo();
  
      function sayFoo() {
        console.log(this.foo);
      }
    }
  }
  
  myCoolThing.doSomething(); // Errors with "foo" undefined
  </code></pre>