title: how do I create a group for objects in ES5 javascript
body: <p>I have created objects and prototypes in ES5, now I want to create a new prototype which will group existing object, I have this code</p>
  <pre><code>    const person = function(firstName,lastName){
      this.firstName =firstName;
      this.LastName = lastName;
      
      this.getFullName = function () {
      return firstName + ' ' + lastName ;
      };
  
      this.setFullName = function(firstName, lastName) {
      firstName = firstName.split(' ')[0];
      lastName = lastName.split(' ')[1];
  
      };    
      
      };
  </code></pre>
  <p>I created a student prototype that is an extension of the person class</p>
  <pre><code>    const student = function(firstName,lastName, grade ) { 
       person.call(this, firstName, lastName);
      
      this.Averagegrade = grade;
       };
  
  
    const group = function(Title, firstName,lastName, grade ) { 
         this.Title = Title;
         person.call(this, firstName, lastName);
         student.call(this, grade);
      
      
      
         const addstudent = Object.create(person);
             return firstName + ' ' + lastName ;
           
      
      
      }; 
  
  
  group.__proto__ = student;
  const john = new student('Jack','Sparrow', '53');
  john.setFullName('Jack', 'Sparrow');
  
     const group1 = new group( &quot;group1&quot;);
     group1.addstudent(john);
      console.log(group1);
  </code></pre>
  <p>but I keep getting this as output</p>
  <pre><code>     group {
        Title: 'group1',
        firstName: undefined,
        LastName: undefined,
        getFullName: [Function (anonymous)],
        setFullName: [Function (anonymous)],
        Averagegrade: undefined
      }
  </code></pre>