7. search for a friend


Not sure what the issue is with my code. It keeps saying there was a problem with my syntax. Please help!

var friends = {
bill: {
firstName: "Bill",
lastName: "Gates",
number: "(414) 564-8987",
address: ["One Microsoft Way", "Redmond", "WA", "98052"]
steve: {
firstName: "Steve",
lastName: "Gate",
number: "(414) 564-8977",
address: ["Three Microsoft Rd", "Milwaukee", "WI", "53216"]

    var list = function (friends) {
        for (var list in friends) {


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


The only thing that I can see is the line where you have friends[key]firstname; you should have a period before firstname so that it shows friends[key].firstname.


It still says I have an unexpected identifier. This is probably the only thing holding me back from passing this section.


Nvm I solved the issue. :slightly_smiling: