Contact list, exercise 6 list em all issue


#1

https://www.codecademy.com/courses/javascript-beginner-en-3bmfN/0/6?curriculum_id=506324b3a7dffd00020bf661#
The code works fine for bill and steve and prints out their first names "Bill" and "Steve", but instead of printing out "Test", it prints out testFriend...which is not the first name, its the object.

`

var friends = {
bill: {
firstName: "Bill",
lastName: "Billington",
number: "416-734-7907",
address: ["1833", "Misthollow Drive", "Pickering", "Ontario", "L1X0A7"]
},
steve: {
firstName: "Steve",
lastName: "Johnson",
number: "783538-7307",
address: ["1C", "Manor Road", "Wallington", "London", "SM6 0BW"]
},
testFriend: {
firstName: "Test",
lastName: "Friend",
number: "123-456-7891",
address: ["13 Oriel Court", "47 Lansdowne Road", "Croydon", "London", "CR0 2BE"]
}
};

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

'


#2

HI I ran you code and I got that

bill
steve
testFriend

which is right since the for loop loop through the object friends which contains

bill
steve
testFriend