Loop the loop



Make sure to log to the console the name of each object

Replace this line with your code. 
// Our Person constructor
function Person(name, age){
    this.name= name;
    this.age = age;

// Now we can make an array of people
var family = [];
var alice = new Person('alice', 40);
var bob = new Person('bob', 42);
var michelle = new Person('michelle', 8);
var timmy = new Person('timmy', 6);
family[0] = alice;
family[1]= bob;
famliy[2] = michelle;
family[3] = timmy;

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



famliy[2] = michelle;
This is your bug!



Do what @greentreemee said
also you've extra lines of code.you can do directly

family[0] = new Person('alice', 40);


@greentreemee @rcodeman thank you both. I needed some time to spot misspelling even now when i knew where the mistake was. :grinning:


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.