6/8, it lets me pass but it prints out each object two times


#1

Hi I just want to know why does it print both objects two times and why, not to be mistaken with the first names.
Appreciate the help! :+1:

This is my code:

var friends = {
bill: {
firstName: "Bill",
lastName: "Monday",
number: "(555) 555-5557",
address: ['Microtec enterprises', '21', 'MIA']
},
steve: {
firstName: "Steve",
lastName: "Jacobs",
number: "(444) 444-4445",
address: ['California', "20-21", 'Grove Avenue']
}
};

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

it prints out:

steve
bill
steve
bill


#2

@alfre360,

In some sections of this course, the course-checker Display's data
this you could then identify by placing two EXTRA code-line's:
console.log( "== My End ==" );
console.log( "== All that is displayed after this, is the course-checker ==" );


#3

This worked for me:

var friends = {
bill: {
firstName: "Bill",
lastName: "Gates",
number: (555)-555-5555,
address: ['One Microsoft Way', 'Redmond', 'WA', '98052']
},
steve: {
firstName: "Steve",
lastName: "Jobs",
number: (555)-555-5555,
address: ['Douche Bag Way', 'A-Hole', 'CA', '55555']
}
};
var list = function(friends) {
for(var firstName in friends) {
console.log(firstName);
}
};