title: Using private members and methods in javascript
body: <pre><code>var test = function(id, company){
      //public members
      this.id = id;
      this.company = company;
      //private member
      var age = 24;
      //private method
      var getAge = function(){
         return this.age;
      };
      //public method
      this.displayAge = function(){
         console.log(getAge());
      }
  }
  
  //invoking 
  
  var t = new test(1, 'XYZ Corp');
  
  t.displayAge(); //undefined
  </code></pre>
  
  <p>Why is it not getting displayed</p>