Loop the loop


#1

im having trouble with this code, can someone please help to correct it?

// Our Person constructor
function Person (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(n = 0; n <= length.family; n++) {
    console.log(family[n].name)
}

Loop the Loop
#2

your function is missing its closing curly bracket (}), that is a huge problem


#3

where do I need to put the curly bracket?


#4

after you finished your person constructor?

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

The forum is to help, not to give complete answers


#5

alright, thanks. Ill try it.