Displaying people


Can anyone help with my code. I have a "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 really don't know why;

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



Remember to add a semicolon after defining your printPerson function


thanks but I added it and i still have the same message


this text appears in the console : undefined Jones
undefined Johnson


In your printPerson function change "" by " ". I mean use a space between the firstname and lastname


thx. I am sorry I still don't ubderstand: i already left a space btw the firstname and lastname . I even added a new space but i still get the same message. Don't really understand because my code is the same as the others on the forum


I got it: it was the capital N of lastName ( i made the error of writing a lowercase). Thx a lot for trying to help


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