Javascript, Contact List, Search for a friend Excercise; Need Help


#1

I am having trouble doing the exercise and it keeps saying I need a end curly bracket. Can Someone help me do this exercise?


#2

Here's the code I have put in:var friends = {
bill: {
firstName: "Bill",
lastName: "Gates",
number: "(206) 555-5555",
address: ['One Microsoft Way','Redmond','WA','98052']
}
steve: {
firstName: "Steve",
lastName: "Jobs",
number: "(321) 234-1295",
address: ['Zero Apple Way','PottsBurgh','PA','23000']

    }

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

    }
    for(var steve in friends){
        friends[steve]
        console.log(steve);
    }

}

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

      }    
}

#3

@rubyace20190

Put semicolon after declaring each of your variable after you close the curly bracket so that Javascript understands you put different instructions at a time!