7. Search for a friend



Oops, try again. It looks like your search function doesn't return contact information for Steve.
What do I need to do to return this info. correctly?

var friends = {
    bill: {
        firstName: "Chiedo",
        lastName: "John",
        number: "(540) 555-5555",
        address: ['177 Silver Lake Rd.', 'Dayton', 'VA']
    steve: {
        firstName: "Steven",
        lastName: "Holsinger",
        number: "(540) 777-7777",
        address: ['207D Weeping Willow Ln.', 'Bridgewater', 'VA']

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


Problem is in the friends object. Codecademy expects that the firstName of bill will be "Bill" and firstName of steve should be "Steve".


Thanks! I was actually just coming back to say I figured it out!


Glad to hear that :slight_smile: You're welcome!


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