Search for a friend


#1

var friends = {
bill: {
firstName: "Bill",
lastName: "Gates",
number: "(605) 555-5555",
address: ['yolo way', 'eco dr', 'WI', '90003']
},
steve: {
firstName: "Steve",
lastName: "Jobs",
number: "(605) 555-5544",
address: ['yokoko way', 'walla dr', 'MN', '34004']
}
};

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

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

**Have no idea what's wrong....
keeps saying
"Oops, try again. Did you create a function called search?"


#2

Hi this part

var serach = function(name)

You wrote serach instead of search