Stuck in contact list exercise


#1



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


I'm stuck at this exercise, I get the message "Oops, try again. Did you create a function called list?"
What I'm doing wrong?

Thanks!


var friends = new Object();

friends.bill = new Object();
friends.steve = {};
friends.pepe = {};

//bill
friends.bill.firstName = "Bill";
friends.bill.lastName = "Pax";
friends.bill.number = 666;
friends.bill.address = ["Microsoft st", "redmond", "wa", 90210];
//steve
friends.steve.firstName = "Steve";
friends.steve.lastName = "Chow";
friends.steve.number = 342;
friends.steve.address = ["stevestreet", "cali", "cf", 453043];
//pepe
friends.pepe.firstName = "Pepe";
friends.pepe.firstName = "Chompiras";
friends.pepe.number = 111;
friends.pepe.address = ["street 15", "buenos aires", "md", 11600];

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


#2

To keep all the data of on general type, string, try writing the phone numbers in quotes:

friends.bill.number = "405-678-0206";

The same could apply to the ZIP codes.

The more obvious issue is with the list() function, itself. There is no variable, firstName defined and neither is object defined.

var list = function (friends) {
    for (var key in friends) {
        // console.log(friends[key].firstName);  // is valid but not asked for
        console.log(friends[key]);               // what is expected
    }
};

`