7. Search for a friend


Hi All,

Having some trouble with the final task. Code is here:
var friends = {
bill: {
firstName: "Bill",
lastName: "Gates",
number: "123",
address: ['one microsoft way', 'richmond', 'usa'],
steve: {
firstName: "Steve",
lastName: "Jobs",
number: "987",
address: ['5 cupertino', 'brunswick', 'usa'],

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

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


any help would be appreciated!


in search function .
if (friends [key.steve === name)
your key missing the ' ] '.

and you have to make the function execute.
Add search('Steve') ;in the bottom.

In normal way,It also have mistake in this lesson.
Try to change first letter of friend's name to capital letter in friends object.
like that Bill:{}, Steve:{} .

my english is not good,but i hope it is helpful for u.: )