Building an Address book


#1


I am very stuck with this code.


It looks like your function didn't log "Bob Jones" to the console. Did you remember to call your function on bob?


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

function list() {
for (i = 0; i < contacts.length; i++)
printPerson(contacts[i]);
}

hlp, please!


#2

you never call your list function, so it never executes, so nothing is logged to console


#3

THANKS!! I works perfectly!


#4