I don't know what's wrong!


#1
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);
}

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

list();

#2

What error are you receiving?


#3

I see what you are missing in your code where is says:

printPerson(i)

you are not telling the computer what to output you just said i.
If you want to get the computer to output the people try this:

printPerson(contacts[i]);

Now you are telling the computer to output the info in the array contacts.

Hope this helps! -awk888 :wink: