Why is this code giving error and not printing name of each object in array family?


#1

function Person(name, age)
{
this.name = name;
this.age = age;
}
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

Can you PLEASE read THIS Link