function PersonXYZ(fName, lName) {
this.lastName = lName;
this.firstName = fName;
this.grades = [];
this.grades.push([4, 67, 5]);
this.grades.push([41, 63, 5]);
this.grades.push([4, 67, 55]);
}
var person = new PersonXYZ('John', 'Doe');
person.grades.forEach(function iterateArray(arr1, arr2) {
arr1.forEach(function displayValue(val1) {
console.log(val1);
});
arr2.forEach(function displayValue(val2) {
console.log(val2);
});
});
I encountered the Error: arrSch2.forEach is not a function
I am puzzled as to why arrSch2.forEach is not working properly. Isn't the second element of grades an array with the values [41, 63, 5]?