27/33 Stuck


#1

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

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);

for(var i = 0; i{
console.log(family[i]name);
}

It says I have a missing ) at the end of a list


#2

the for loop didn't paste all the way
I have it as

for(var i = 0; i < family.length; i++) {
console.log(family[i]name);
}


#3

It looks like you forgot the "." after [i] in your for loop.

for(var i = 0; i < family.length; i++) {
console.log(family[i].name);
}


#4

weird, i have the same exact syntax and mines not working.... for loop reads for(var i = 0; i < family.length; i++) {
console.log(family[i].name};


#5

You shouldn't have a semi-colon " ; " after your closing bracket " } " to your for loop.


#6

ya, i took that off and was still getting the error but i realized when i was added values to the array i was doing var family[1] = new Person("timmy",6); instead of just doing family[x]... that solved the issue