[solved]7. search for a friend


#1

My code doesn't return contact info for bill.


var friends = {}
friends.bill= {
    firsName: "Bill",
    lastName: "Bill",
    number: "111-222-3333",
    address: ['One Microsoft Way', 'Redmond', 'WA', '98052']
    },
friends.steve= {
    firstName: "Steve",
    lastName: "Steve",
    number: "999-888-7777",
    address: ['One Microsoft Way', 'Redmond', 'WA', '98052']
    };

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

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

I figured it out. I forgot to put a t in the first .firstname


#2