This is my code. It passed and I am getting a double Undefined. Not sure why?
`var bob = {
firstName: “Bob”,
lastName: “Jones”,
phoneNumber: “(650) 777-7777”,
email: "[email protected]"
};
var mary = {
firstName: “Mary”,
lastName: “Johnson”,
phoneNumber: “(650) 888-8888”,
email: "[email protected]"
};
var contacts = ;
bob = [0];
mary = [1];
// printPerson added here
var printPerson = function(person) {
console.log(person.firstName +" "+ person.lastName);
};
Here is the part of the code that confuses many people.
// contacts array
var contacts = [bob, mary];
/* printPerson function added here, this will print out the first and last name of your contacts */
function printPerson(person) {
console.log(person.firstName + " " + person.lastName);
};
// calls the printPerson function
printPerson(contacts[0]);
printPerson(contacts[1]);
I will point out one thing though, by now you must have been taught something very similar to this a few times already. If you don’t understand something it is perfectly fine to go back a little and try to refresh your skills. Don’t just try to rush through it all, no one can learn all about coding in a day. It takes time.