Oops, try again. Did you create a function called search?


#1


var friends = {
       bill: {
           firstName: "Bill",
           lastName: "Gates",
           number: "111 111 1111",
           address: ['777 pennyway drive', 'redmond, va', '18274']
       },
        
        steve: {
           firstName: "Steve",
           lastName: "Jobs",
           number: "333 333 2222",
           address: ['555 i got money street', 'chaching, ca', '55555']
        }
};
   var list = function(friends){
    for(var lastName in friends){
        console.log(lastName);
        
    
}
var search = function(name)
    {
        for (var key in friends)
        {
           if (friends[key].firstName === name)
            console.log(friends.firstName);
            return friends[key];
        }
    }
}


I’m not sure why I only get this error~


#2

your search function is nesetd inside your list function, the search function should be after the list function


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.