Stuck on syntax error for Intro to Objects


#1


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


SyntaxError: expected expression, got ';'


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

// Now we can make an array of people
var Array = 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);
var family[0] = (alice);
var family[1] = (timmy);
var family[2] = (michelle);
var family[3] = (timmy);

// loop through our new array
for (i = 0, i > 3, i++) {
    console.log(family[i].name)
};


#2

I am sorry, but every part of the code is faulty. You should get few sections back to refresh your knowledge.


This is not a whole constructor:

function Person(name, age);

where is the function body?


var Array = family;

You have created variable named Array and assigned it value of variable family which is undefined.


Are you sure that we use commas to separate parts of for loop?

for (i = 0, i > 3, i++) {
    console.log(family[i].name)
};

Try to solve each of this problem without our help. These are really trivial mistakes.


#3

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