7. Need help!


#1



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


I keep getting the error "Oops, try again. It looks like your search function doesn't return contact information for Steve." Please help. Thank you!


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

}


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


#2

@jcarrot,

+++ friends list and search and for-in explained.
Look here for an explanation
object
function
for-in-loop
list-function
search-function
http://www.codecademy.com/forum_questions/545275fd8c1ccc8e3e000a23#comment-5457b12c9c4e9d87cb00003f