Hi guys, please i need help..what is wrong with this code? thanks


#1

var friends = {};
friends.bill =
{
firstName: 'Bill',
lastName: 'Gates',
number: '204-38-232',
address: ['One Way','Redmond','WA','98052']

};

friends.steve = {
firstName: 'steve',
lastName: 'Jobs',
number: '204-30-232',
address: ['One Microsoft Way','Redmond','WA','98052']

};
var list = function(friends){
for(var fort in friends){
console.log(fort);
}
};

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

search("Steve");


#2

@skiillarchi,

In friends.steve you should change
the property firstName: 'steve'
into property firstName: 'Steve'


#4

thanks, i should be more careful next time.