Need help on part 7 Search for a friend


#1

Here is my code

var friends = {
bill: {
firstName: "Bill",
lastName: "Thorton",
number: "(765) 869-7654",
address: ['42 East Redwood St', 'Charming','CA','99017']
},
steve: {
firstName: "Steve",
lastName: "Johnson",
number: "(765) 246-8435",
address: ['64 Clarence St','Charming','CA','99017']
}
};
var list=function(friends) {
for (var friends in friends) {
console.log(friends);
}
};
var search=function(name) {
for (var friends in friends) {
if(friends[bill].firstName==="Bill") {
console.log(friends[number]);
return friends[number];
}
}
};

says it doesn't return information for steve, I know i'm missing something in the function probably, but I don't know what it is. Can someone help me out with this please.


#2

You cant say

You need another name like

for (var key in friends) {

Secondly
its

Because we want to check for the the call's input.

And we return the key like this:

console.log(friends[number]);
return friends[number];

Fix those and you should be good! If not please reply saying so!