Loop the loop


#1


Loop the objects--family Array.


The code returns undefined family names. The error says 'Your person constructor does not allow identification of the person's name'. Please review and make suggestions.


Replace this line with your code.


#2

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

// loop through our new array
for (i = 0; i < family.length; i++) {

console.log(family[i].name);

};


#3

here:

var family = Array();

you want to create a new Array(); i assume?


#4

I made the change. The error still says 'you person constructor does not identify the first argument as the person's name.'


#5

Do you think this be a bug in the system? I use Chrome browser and also ran this on Firefox with the same results.


#6

Can someone please help get past this spot. If the code is correct, what can I do to move on??


#7

make sure your this.name and this.age don't have any capitols in them.


#8

Thank you. Changing the Name to name fixed it. I appreciate your help


#9

No problem! @stetim94 found the main problem I just cleaned it up for ya :stuck_out_tongue:


#10