6/6 "We made a friend!"


Hi there! So this specific chapter here is killing me. I finished the whole thing except for this, and at this point, I think the world simply doesn't want me to finish this, but the thing is I have a deadline (tomorrow) so I would really appreciate an immediate response. Anyway, so here is my 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, miles];

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

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

/*Create a search function
then call it passing "Jones"*/
function search (lastName) {
var contactsLength = contacts.length;
for (var i = 0; i < contactsLength; i++) {
if(lastName === contacts[i].lastName)

var miles = function(firstName, lastName, email, phoneNumber) { contacts[contacts.length] ={
firstName : firstName,
lastName : lastName,
email : email,
phoneNumber : phoneNumber

add("Miles", "Roman", "isneezedonthebeatandthebeatgotsicker@gmail.com", "(012) 3456789");

and here is my "mistake":

Oops, try again.
Did you create a function called add?

I even used a debugger and yet here I am. Anyway, I want to thank in advance the kind angel who'll help me.


I don't see an add function anywhere...

It would start like:

var add = function() {



It's this one, I just replaces it with a name, but I tried replacing :


and the :


var contacts = [bob, mary, add];

This was the output:

Bob Jones
Mary Johnson
undefined undefined
Miles Roman

and it told me:

Oops, try again.
It looks like you didn't add an person object to the end of your contacts array.


Rename the function add and call add on your new miles contact.

This is what it wants you to do. :slightly_smiling:


God thanks. You are literally a hero from my fated disaster. Kudos to you. :grinning:


Anytime! :wink:

Have fun! :slightly_smiling: