Question: So I am now making an address book using js. This is an exercise from codecademy. I am now trying to write a function that lists all users. Here is what I have so far:

```
var bob = {
    firstName: "Bob",
    lastName: "Jones",
    phoneNumber: "(650) 777-7777",
    email: "bob.jones@example.com"
};

var mary = {
    firstName: "Mary",
    lastName: "Johnson",
    phoneNumber: "(650) 888-8888",
    email: "mary.johnson@example.com"
};

var contacts = [bob, mary];

function printPerson(person) {
    console.log(person.firstName + " " + person.lastName);
}

```

This is the whats is killing me. The error I am getting is "SyntaxError: Unexpected keyword 'for'. I know it seems a little incomplete, but not sure how to fix it. Any ideas? 

```
var list = function () {
  var contactsLength = 
  for (var i = 0; i < contacts.length; i++);
    printPerson();
}
list();

```

Answer: 
You have a couple of issues. One of which has been pointed out (missing the assignment of the `contactsLength`; though you don't actually need to do this if you look at my second chunk of code.

The other is a little less obvious - you need to pass in a person to the `printPerson()` method. Your `printPerson()` method has a parameter `person`. This needs passing in.

So change your code to this:

```
var list = function () {
  var contactsLength = contacts.length;
  for (var i = 0; i < contactsLength; i++)
    // You need to pass in the person to print!
    // contacts[i] is going to fetch the person in the list at position i
    printPerson(contacts[i]); 
}
list();

```

Also - the contactsLength isn't really needed. You can just call `contacts.length` in the loop instead (as you had before)

```
var list = function () {
  for (var i = 0; i < contacts.length; i++)
    printPerson(contacts[i]); // You need to pass in the person to print!
}
list();

```
```
var contactsLength = 

```

That line is causing your syntax error.

I'm guessing you wanted:

```
var contactsLength = contacts.length;
for (var i = 0; i < contactsLength; i++) {
    printPerson();
}

```

**Note** Your loop was also missing a closing bracket.