title: javascript adding into arrays
body: <p>I need to be able to add a student and a grade. however, I am having a difficult time figuring out how to enter a grade. This is what I have so far. When I run the program like this I get: <code>[ Student { name: 'Bob', grades: [], totalGrades: 0 } ]</code> Any help would be appreciated!</p>
  
  <p>The commented out section was an attempt at adding grades, however, I did not work at all.</p>
  
  <pre><code>function Student(name){
      this.name = name;
      this.grades = [];
  
      this.totalGrades = function(){
          this.totalGrades = 0;
          this.grades.forEach(grade =&gt; {
              this.totalGrade += grade;
          })
      }
  }  
  
  function Students(){
      this.students = [];
     // this.grades = [];
  
     /* this.addGrade = function(grade){
          this.grades.push(grade);
      }*/
  
  
      this.addStudent = function(student){
          this.students.push(student);
      }
  
      this.calcTotalGrades = function(){
          this.students.forEach(student =&gt; {
              student.totalGrades();
          })
      }
  }
  
  let students = new Students();
  students.addStudent(new Student('Bob'));
  
  students.calcTotalGrades();
  console.log(students.students);
  </code></pre>