3.Displaying people


#1

It is giving me error which is given below
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?
And my code is given below pls help me out

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
function printPerson(person) {
console.log(person.firstName+""+person.lastName);
}
printPerson(contacts[0]);
printPerson(contacts[1]);


#2

The empty string causes the print out,

BobJones

which the SCT does not recognize. Try using " ".


#3

thanks for helping me.......


#4

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