Displaying people


I am at the part where you use the "printPerson" function to call the names.

Every time i hit save and submit, it asks me if i remembered to make a printPerson function, even though i clearly made one and it works. The console logs "Bob Jones" and "Mary Johnson." I think it is the system. Please help dev team and fix it. Here is the 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(contacts[person].firstName + " " +



i think they want us to use "this" from the prior lesson. but my code looked just like yours and makes more sense to me. the "this" throws me off.


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

Try this


It worked, but i don't understand why the other method is not counted...


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