title: How to use "this" inside an immediate function
body: <p>i'm trying to encapsolate my code inside an immediate function that later on will be accessed via the global variable x and act like a "module".</p>
  
  <p><strong>code:</strong></p>
  
  <pre><code>var x = (function () {
  
      console.log(x); // undefined
      console.log(this); // undefined
  
  })();
  </code></pre>
  
  <p>But I don't understand why I cant use <code>this</code> to refer to the function itself.</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>the immediate function is inside another function in <strong>strict mode</strong> (<code>"use strict"</code>)</p>