27. Loop the Loop. Maximum call stack size exceeded


#1


https://www.codecademy.com/en/courses/spencer-sandbox/4/1?curriculum_id=506324b3a7dffd00020bf661
I keep getting this message. Can I get a little help? Oops, try again. When trying to create a new Person the following error was thrown: RangeError: Maximum call stack size exceeded


// Our Person constructor
var Person = function (name,age) {
    this.name;
    this.age;

// Now we can make an array of people
var family = new Array(); 

// loop through our new array
family[0] = new Person("alice", 40);
family[1] = new Person("bob", 42);
family[2] = new Person("michelle", 8);
family[3] = new Person("timmy", 6);

for (var i = 0; i < family.length; i++) {
    console.log(family[i].name);
}
};


#3

@robet3,
Try it with

var Person = function (name,age) {
    this.name = name;
    this.age = age;
};
// Now we can make an array of people
var family = new Array(); 
// better to use = var family = []; =


// loop through our new array
family[0] = new Person("alice", 40);
family[1] = new Person("bob", 42);
family[2] = new Person("michelle", 8);
family[3] = new Person("timmy", 6);

for (var i = 0; i < family.length; i++) {
    console.log(family[i].name);
}

#4

Thank you, the mistakes I made were simple. I have a lot of practicing to do.