We Made a Friend! Stuck :(


#1


https://www.codecademy.com/en/courses/building-an-address-book/0/6?curriculum_id=506324b3a7dffd00020bf661


Oops, try again. It looks like there are still only two items in the contacts array.


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

search("Jones");
var add = function(firstName,lastName,email,phoneNumber) {
 var newContact = {
     firstName:firstName,
     lastName:lastName,
     email:email,
     phoneNumber:phoneNumber
 }
 contact[contacts.length]=newContact;
}

add("mochi","taylor","949-949-9499","sdjksjdk@example.com")
list();


#2

Hi this line

 contact[contacts.length]=newContact;

you wrote contact instead of contacts

 contact[...

#3

thank you very much
i checked it about 5 times and didnt see that lol


#4

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