Building an address book - 3. Displaying people


#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];

// printPerson added here
var printPerson = function(person){
console.log(person.FirstName + " "+ person.LastName);

}

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

--- Please can someone more experienced explain why the function is not called to bob


#2

it's case sensitive in this case,
try to change from "FirstName" to "firstName" and "LastName" to "lastName"


#3


please help me


#4

sorry I haven't been in for a while.
Have you solved it yet? I tried to take a look in the picture you attached as I can see that,
you should break it down in 2 lines like this ;

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