I'm encountering an issue while attempting to iterate through an array of objects, as I keep receiving the error message: "Cannot set property 'color' of undefined". Could someone please help me troubleshoot this problem?
var ObjectTest = function(something1, something2){
this.Name = something1;
this.Job = something2;
this.color = '';
this.numbers = [];
}
var first = new ObjectTest('Paul', 'teacher');
var second = new ObjectTest('Jane', 'doctor');
var third = new ObjectTest('Mike', 'student');
var someArray = [];
someArray.push(first, second, third);
console.log(someArray);
for(var i = 0; i < someArray.length; i++){
someArray[i].color = 'red';
};