Displaying People


#1


https://www.codecademy.com/courses/building-an-address-book/0/3?curriculum_id=506324b3a7dffd00020bf661


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

I am not sure why this occurred because Bob Jones did appear in the console.


Replace this line with your code. 
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];

// printPerson added here
var printPerson = function(person) {
    console.log(person.firstName);
    console.log(person.lastName);
}

printPerson(contacts[0]);
printPerson(contacts[1]);


#2

@applepies, error says:
It looks like your function didn't log "Bob Jones" to the console. Did you remember to call your function on bob?

Try this:

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

#3

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