6. List 'em all!


#1


https://www.codecademy.com/courses/javascript-beginner-en-3bmfN/0/6?curriculum_id=506324b3a7dffd00020bf661#


It looks like your list function isn't printing the right output.


var friends = new Object();
   friends.steve = {
       firstName: "Steve",
       lastName: "Braithwaite",
       number: 14563839900,
       address: ["8 Maes Celyn", "Llanbedr"],
       };
   friends.bill = {
       firstName: "Bill",
       lastName: "Brzezinka",
       number: 4914895903030,
       address: ["37 Heathside", "Manchester"],
       };
   
var list = function(friends) {

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


#2

You want to print out friends so you would type,

console.log(key)

and not,

console.log(list) //Which is the function name. :slight_smile:


#3

Ahh, brilliant - thank you!! :smiley:


#4

No problem mate :grin:


#5

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