I have code like this, then I was confused on how to loop the array family to print each member under person.
function Person(name,age){ this.name = name; this.age = age; } var family = []; family[0] = new Person("alice",40); family[1] = new Person("bob",42); family[2] = new Person("michelle",8); family[3] = new Person("timmy",6);
forloop, then look upjavascript objects. If you cant figure it out then take a tutorial or two. This isn't even a question... How aboutfor(person in family){ alert(family[person].name); }... See how simple?