7/8 error message


#1

my code is

var friends = {};
friends.bill = {
firstName: "Bill",
lastName: "Gates",
number: "111)1111-1111",
address: ['a', 'b', 'c']
};
friends.steve = {
firstName: "Steve",
lastName: "Jobs",
number: "222)2222-2222",
address: ['d', 'e', 'f']
};
friends.howard = {
firstName: "Howard",
lastName: "Schultz",
number: "333)3333-3333",
address: ['g', 'h', 'i']
};

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

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

it makes error message "Oops, try again. It looks like your search function doesn't return contact information for Steve."

I don't know why???

please help me


#2

See carefully:

var search = function(prop) {
    for (var prop in friends) {
        // where have you defined `name` variable?
        if (friends[prop].firstName === name) { 
            console.log(friends[prop]);
            return friends[prop];
        }
    }
};

#3

thank you so much. I fixed it!