title: JavaScript access parent object attribute
body: <p>I have a small issue in JS, I have two nested objects, and I would like to access a variable from the parent, like so:</p>
  
  <pre><code>var parent = {
      a : 5,
  
      child: {
          b : 3,
          displayA : function(){
              console.log(this.a);
              //undefined
              },
  
          displayB : function(){
              console.log(this.b);
              //displays 3
              }
          }
  }
  </code></pre>
  
  <p>And I would just like to know how to make parent.child.displayA work :) (I have sub-objects that need access to a parent's variable)</p>
  
  <p>Any help appreciated
  Thank you very much!</p>