27. Loop the loop


#1


#2

It should be i++ instead of family++.


#3

And isn't console.log(family[i]); enough to print out all family members? I think there is no need in mentioning "name" property


#4

I'm stuck on this one too, but textmaster40695 is right, but also, you're only going to print in the order of the array, not in order of age.


#5

Thanks for your help, this is my code now
// 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(family[i].name);
};


#6

In your Person constructor, you started it with 'var', when it should be 'function'.