Lesson 7 , search for a friend, need help


#1



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


it keeps saying that this doesn't return contact info for steve and i have no idea why


var friends = {
    bill: {
        firstName: "Bill",
        lastName: "Gates",
        number: "(206) 555-5555",
        address: ['One Microsoft Way','Redmond','WA','98052'],
    },
    steve: {
        firstName: "steve",
        lastName: "jobs",
        number: "(207) 555-5755",
        address: ['One Apple Way','Redmond','fl','18062'],
    }
};
var list = function(friends){};
for(var key in friends) {
    console.log(key)
}

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

  console.log(search("steve"));


#2

Cause steve is not Steve :slight_smile:
Casesensitive


#3

omg you've got to be kidding me , wow, I cant believe that lol. thanks so much


#4