27 Loop To Loop Error Syntax [


#1



https://www.codecademy.com/en/courses/spencer-sandbox/4/2?curriculum_id=506324b3a7dffd00020bf661


SyntaxError: Unexpected Token [

I have no idea where this error is coming from. I've been staring at it too look. Where am I making the error?

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 = new Array();
var family[0] = new Person("alice", 40);
var family[1] = new Person("bob", 42);
var family[2] = new Person("michelle", 8);
var family[3] = new Person("timmy", 6);

// loop through our new array
for (var i = 0; i < family.length; i++){
     console.log(family[i].name);
};


#2

@lptaylor

I think your code is correct. Try refreshing the webpage.


#4

Well, that did not work. I logged off and login, as well as refreshed using F5 and no success.


#5

you don't need any variable after first variable you created.

any question????


#6

function Person(name,age){
this.name=name;
this.age=age;
};
var family=new 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(var i=0;i console.log(family[i].name);
}indent preformatted text by 4 spaces


#7

Thanks rcodeman! This is what happen when you look at code for too long. Stepping away from the computer now. hahahaha! Thanks sooo much!