4/6 first time ive been not just stuck, but stuck stuck


#1

Please help! Thank you!!

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

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

var list = function(){
var contactsLength = contacts.length;
for (var i = 0 ; i < contactsLength; i++){console.log (printPerson)};
};

list();

**RETURNS
[Function: printPerson]
[Function: printPerson]
[Function: printPerson]
[Function: printPerson]**

Oops, try again. It looks like your list function didn't console.log "Bob Jones". Did you remember to call list(); after creating it?


#2

FIXED.

Had to call printPerson(contacts[i]) in my for loop to get the correct output.