27/33 please help me solve it


#1

// Our Person constructor
var family = function Person(name,age)
this.name = name;
this.age = age;
// Now we can make an array of people
var family = {}
family[0]=new Person("alice", 40)
family[1]=new Person("bob", 42)
family[2]=new Person("michelle", 8);
// loop through our new array
for (i=0; i console.log(family[i].age);
}

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


#2

You forgot the open and closing brackets of your constructor.

function Person (name,age) {
this.age = age;
this.name = name;
}

Also, your family array should be created like this:

var family = new Array();