Function not being read


#1

12.Contact List in JS

When I use this code, no syntax errorss appear, but the level tells me that I didn't create a function called list.


var friends = {
    bill: {
        firstName: 'Bill',
        lastName: 'Gates',
        number: '(206) 555-5555',
        address: ['One Microsoft Way', 'Redmond', 'WA', '98052']
        },
    steve: {
        firstName: 'Steve',
        lastName: 'Jobs',
        number: '(408) 555-5555',
        address: ['1 Infinite Loop','Cupertino','CA','95014']
        }
};
var list = function (friends) {
    for(var key in object) {
        console.log(friends);
        }
};


#2

You want to print the keys of the object friends.

for(var key in friends) {  //for each key in the object friends,
    console.log(key);     //print the key.

#3

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