Intro to Objects


#1

Please help;
Something must be wrong with my codes but i am trying with no solutions yet. please help with this codes here:

// 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 (var i = 0; i<4, i++;)
{console.log(family[i].name);
}

#2

unnecasery semi-colon after i++


#3

Oops. Didn't help. Looks like something wrong on line of var family = new array (); i am not sure what.


#4

for (var i = 0; i<4, i++)

you used , instead of ; after i<4


#5

You are awesome! Thanks so much for the help. It works.