Loop The Loop


I need help with the Loop the Loop section, It keeps returning "There was a problem with your syntax", and the console returns:SyntaxError: Unexpected token {

// Our Person constructor
var person = new Function(name,age){
    this.name = name;
    this.age = age;  }  

// Now we can make an array of people
var family = 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 (i=0;i<family.length;i++){ console.log(family[i].name);}



var family = Array();

if ou want to use this way to create a new Array, you need to use the new keyword


That`s Still no use.



var person = new Function(name,age)

the Person should have an uppercase fist letter, the exercise expects the right name (this is case sensitive)

a function shouldn't have a new keyword

keywords are case sensitive, function is all lowercase

if you need more help, post an updated version of your code


Thank you, all good :slight_smile: