Help us understand what we do wrong?


#1

I also got stuck on mine, which is quite simmilar with muhsin7704.
Could you guys help us understand what we do wrong?

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


27 Loop the loop
#2

You have syntax error in for loop:
for (i = 0; i < family.length; i++)...


#3

I just discovered right now. Now is working.
My way of finding out was a JS validator (just search on google) which told me where the mistakes were.
Thanks, denys!


#4

You always can check your code in browser console.


#5