Contact list exercise with search function


I guess I have figured out the code but the search doesn't seem to provide the properties of the desired friend. I am able to see the firstName correctly however the other Properties do not show up. Any help would be appreciated.

var friends = {};
friends.bill= {
    firstName: "Bill",
    lastName: "Gates",
    number: "(555) 555-5555",
    address: ['One Microsoft Way','Redmond','WA','98052']
friends.steve = {
    fristName: "Steve",
    lastName: "Jobs",
    number: "(666) 666-6666",
    address: ['1 Infinite Loop','Cupertino','CA','95014']

var list = function(obj) {
    for(var prop in obj) {

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



this line:

fristName: "Steve",

you misspelled firstName, thus your steve object doesn't have a firstName property, so it can never be found.


Thanks! That got me through!