Loop the loop nothing gets printed



I have no idea why nothing gets printed. I pass the exercise but nothing gets printed. Tried on different platforms

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);
// loop through our new array

for (var i = 0; i < family.length; i++) {


You have to put all the variables(Objects) inside the family Array.
variables - alice,bob,michelle,timmy.

As youre looping over an empty array so its prints nothing.


Oh well :smiley: It's bit embarrassing.


It happens ,use a technique called Rubber duck debugging for hunting bugs!
cheers! :thumbsup:


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