I Don't Understand What's Wrong With My Code


#1

var friends = {
bill: {firstName: "Bill",
lastName: "Gates",
number:2345167,
address: ['One Microsoft Way','Redmond','WA','98052']},
steve: {firstName: "Steve",
lastName: "Jobs",
number: 7263263,
address: ['apple','Redmond','WA','98052']}
};
var list = function (friends){
for(var x in friends){
console.log(friends[x][firstName]);
}
}
it's telling me that I didn't create a function called list?


#2

That's probably the only error message the SCT could apply. The issue is in what is being logged. We need to log the keys, not the firstName values.

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

#4

I got you haha thanks!