6. List them all wont work


I am so confused to why this wont work. My problem is with the for loop, could anyone help with this?

var friends = new Object();

friends.bill = {
    lastName: "Gates",
    number: "(555) 2941",
    address: ["Microsoft"]

friends.steve = {
    firstName: "Steve",
    lastName: "Jobs",
    number: "0345 6060973",
    address: ["The Grave"]

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

Any help would be much appreciated. Thanks


Was having the same issue as you, this is what I was able to do to fix it
var list = function (friends) {
for (var key in friends) {

Just tell the console to log key, instead of friends[key].


Thanks! Much appreciated


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