#7 Contact list


#1

Code

var friends = {
Bill: {
fistName: "Bill",
lastName: "Gates",
number: "(318) 582 - 5839",
address: ['one way', 'to ■■■■']
},
Steve: {
firstName: "Steve",
lastName: "Jobs",
number: "(319) 548 - 8549",
address: ['two ways', 'to sunday']
}
};

var list = function (friends) {
for (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];
}
}
};

list(friends);
search("Steve");


It keeps saying "Oops, try again. It looks like your search function doesn't return contact information for Bill.". What am I doing wrong here? haha


#2

nvm, I just mispelled "fistName" XD