title: Javascript: Object Literal reference in own key's function instead of 'this'
body: <p>Is it problematic to reference an object literal within a function which is part of that very literal? It seems to work just fine, but I want to make sure there aren't other implications.</p>
  
  <p>Here's an example of what I'm talking about:</p>
  
  <p>instead of:</p>
  
  <pre><code>var obj = {
      key1: "it",
      key2: function(){return this.key1 + " works!"}
  };
  alert(obj.key2());
  </code></pre>
  
  <p>using:</p>
  
  <pre><code>var obj = {
      key1: "it",
      key2: function(){return obj.key1 + " works!"}
  };
  alert(obj.key2());
  </code></pre>