Search for a friend problem


#1

Hello. I've recently begun looking into javascript. I've completed the exercises with little problems so far. However, I got stuck in the "Search for a friend problem". The code is the one below

 var friends = {
    bill: {
    firstName: "Bill",
    lastName: "Gates",
    number: 6988,
    address: ["Ilossoy", 16, "Nikea", "Athens", "Greece"]
    },
    steve: {
    fistName: "Steve",
    lastName: "Jobs",
    number: 6848,
    address: ["Ag. Pantwn", 3, "Rentis", "Athens", "Greece"]
    }
};
var list = function (friends) {
    for (var key in friends) {
        console.log (key);
    }
};
var search = function (name) {
    for (var key in friends) { 
        if (friends[key].firstName === name) { 
            console.log (friends[key]); 
            return friends[key]; 
        } 
    } 
};
search ("Steve");

Whever I run it, it produces the following error:
"Oops, try again. It looks like your search function doesn't return contact information for Steve."

And it's entirely true. It instead returns information for Bill!
More specifically:
{ firstName: 'Bill',
lastName: 'Gates',
number: 6988,
address: [ 'Ilossoy', 16, 'Nikea', 'Athens', 'Greece' ] }

I searched the forum through and through. I even searched other sites for a deeper understanding of the "for/in" loop, but I came up empty handed.
Any kind of help would be greatly appreciated. Thank you in advance.


#2

You have a small typo in your steve object: "fistName" should be "firstName".