7/8 It looks like your search function doesn't return contact information for Steve


#1

var friends = new Object();

friends.bill={};
friends.steve={};

friends.bill.firstName =["Bill"];
friends.bill.lastName=["Gates"];
friends.bill.number=["111-111-1111"];
friends.bill.address=['One time','One place','One state','One zip'];

friends.steve.firstName=["Steve"];
friends.steve.lastName=["Jobs"];
friends.steve.number=["222-222-2222"];
friends.steve.address=['Two time','Two place','Two state','Two zip'];

var list = function(friends){
for(var key in friends){
console.log(firstName);
}
}

var search = function(name){
for(var key in friends){
if(friends[key].firstName===name){
console.log(friends[key]);
return friends[key];
}
}

My code won't get accepted. The error message reads: "Oops, try again. It looks like your search function doesn't return contact information for Steve. "

I have looked around on the help boards and the issue seems to be for many people the syntax, or they have a typo in the if() for the search function. I, however, cannot see one in that line. Do I just need to change the syntax or is there something else?

Thanks


#2

Hi @themulkeyway

You just forgot to close the "search" function lol

Hold on :wink: