6: List 'em all


#1

Hey

Can anyone figure out where I'm going wrong on this subject 'List 'em all'-

var friends = {
bill: {
firstName: "Bill",
lastName: "Gates",
number: "(206) 555-5555",
address: ['One Microsoft Way','Redmond','WA','98052']
},
steve: {
firstName: "Steve",
lastName: "Jobs",
number: "(206) 555-5556",
address: ['One Apple Way','Redmond','WA','98052']
},
eric: {
firstName: "Eric",
lastName: "Overall",
number: "(206) 555-5557",
address: ['One Prima Way','Redmond','WA','98052']
},
ben: {
firstName: "Ben",
lastName: "Harris",
number: "(206) 555-5558",
address: ['One Butcher Way','Redmond','WA','98052']
}
};
var list = function (friends) {
for (var key in friends) {
console.log(key);
}
}
};

Any help would be greatly appreciated!

`


#2

Could I see a link to the exercise?


#3

HI you have more } than you need at the end just remove one.


#4

this has done the trick, thank you


#5

I would just add that this exercise is asking to print the names steve and bill, the way you set it up it prints the addresses too. So you want to call the function outside the brackets so that it only prints steve and bill


#6

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.