Search for a friend


#1


https://www.codecademy.com/courses/javascript-beginner-en-3bmfN/0/7?curriculum_id=506324b3a7dffd00020bf661


It looks like your search function doesn't return contact information for Steve.


var friends = {
    bill: {
        firstName:"Bill",
        lastName:"",
        number:" ",
        address: []
        },
    steve: {
        firstName:"steve",
        lastName:"",
        number:" ",
        address: []
        },
    
    };
    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];
                } else {
                console.log("The name is not found");
                }
            }
        };


#2

here:

firstName:"steve",

names like Steve should always have an uppercase first letter


#3

Thanks again for your help :smile:


#4