This is WEIRD! 28/33


#1

it says that
"It looks like the object at index 0 was not created with the Person constructor"
but all i do to fix it is make all my "Family"s lower case and it says problem solved. what's up with that? i even saw a guy who got away with having "familiy" and the rest of his array say "family". did i find a glitch?

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

#2

Which exercise, exactly, are you on?

And what are the exercise instructions?


#3

nevermind problem solved thanks!


#4

Please share how the problem was solved, or this topic becomes useless.


#5

Instructions 28/33

Write a person constructor called Person that has two properties (name and age).
Create an empty array called family.
There will be four objects in the array. Using your Person constructor, create the four objects and put them in the array. The order of the objects are:

"alice" who is 40
"bob" who is 42
"michelle" who is 8
"timmy" who is 6

Create a for-loop that loops through the family array and prints out the name property for each family member in order of creation.

Solution: Instead of family I had Family.