Building An Address List


#1



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


My code runs and I have correct output for this exercise but I i'm told that Bob is not being logged to the console? Can anyone see where i'm going wrong?


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

Hi in your printPerson function these line

console.log(person.firstName + " ");
console.log(person.lastName);

will print each firstName and lastNAme on his line instead of

Bob Jones
Mary Johnson

Put just one console.log() like that

console.log(person.firstName + " " + person.lastName);

#3

and now i've looked again I can see that I have two seperate console.log statements rather than one. and thankyou wizmarco.