Stuck in this lesson!


#1

I have been trying to find the error, someone please help!
This is the error that pops up
"Oops, try again.
When trying to create a new Person a ReferenceError was thrown. Make
sure you properly created the Person constructor. Here's the message:
ReferenceError: Person is not defined"

Thank you


// Our Person constructor
function Person(name, age) {
    this.name = name;
    this.age = age;
};
// Now we can make an array of people
new family = 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);
// loop through our new array
for(i=0; i<family.length; i++) {
    console.log(family[i].name);
};


#2

Hi this line

new family = new Array();

remove the new before family and add var


#3

Thanks a lot that worked!


#4