30 Private Eye


#1

function StudentReport(grade1, grade2, grade3) {
this.grade1 = 4;
this.grade2 = 2;
this.grade3 = 1;
this.getGPA = function() {
var GPA = (this.grade1 + this.grade2 + this.grade3) / 3;
};
}

var myStudentReport = new StudentReport();

for(var x in myStudentReport) {

}

console.log("Your overall GPA is " + myStudentReport.getGPA());

why is this not working


#2

:japanese_ogre: aaaaarrrrrgggggggg


#3

Well, the exercise asks you to modify the lines inside the StudentReport constructor, not simply to erase the lines in the for-in loop... The purpose is to make grade1, grade2 and grade3 private variables, not accessible from outside the object...