My search function doesn't return contact info for Steve, and I don't know why


My code matches the "Stuck? Get a hint" box, but it doesn't return contact info for Steve. Can anybody help me out?

var friends = {
    bill: {
        firstName: 'Bill',
        lastName: 'Gates',
        number: '(800) 825-1000',
        address: ['One Microsoft Way', 'Redmond', 'WA', '98052']
    steve: {
        firsName: 'Steve',
        lastName: 'Jobs',
        number: '(555) 555-5555',
        address: ['1600 Pennsylvania Avenue NW', 'Washington', 'DC','20500']
var list = function(contacts){
    for (var firstName in contacts){

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


What information should your function print and return?
And which information do you print/return?


It should display both properties of friends (bill and steve) with the list function, and display the properties of the object of the searched object (the properties of bill or steve). Right now, it displays both bill and steve, but only shows the properties of bill, no matter what.


Codecademy has a bad tendency to print out the last value used.

You could add this at the bottom of your code:


And then you'll know that anything below that is not from your own code.
I imagine that you're no longer printing properties for anyone, you're printing something else.


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