Search friends help!


#1

Here is my code:

var friends = {
bill:{
firstName: 'bill',
lastName: 'gates',
number: '919',
address: ['1234 blah lane', 'Raleigh', 'NC']
},
steve:{
firstName: 'steve',
lastName: 'jobs',
number: '911',
address: ['4321 halb court', 'Raleigh', 'NC']
},
};

var list = function(friends)
{
for (var key in friends)
{
console.log(friends[key].firstName);
}
};

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

search('steve');

it is telling me that my search function doesn't return the correct contact info for steve.


#2

The names stored in firstName and lastName are supposed to have the first letter capitalized, i.e. firstName: 'Steve'


#3

Yup that was it! thanks for the outsider help