6/8 List'em all! HELP~~~


#1

My code:

var friends = {
bill: {
firstName: 'Bill',
lastName: 'Gates',
number: '123456',
address: ['Taiwan', 'YangMing Mountain', 'House']
},
steve: {
firstName: 'Steve',
lastName: 'Jobs',
number: '3568408',
address: ['Taiwan', 'Hello', 'Hi']
}
};
var list = function (friends){
for(var firstName in object){
console.log(firstName);
};
};

But it says "Did you create a function called list?"
What should i do :confounded: :confounded: :confounded:


#2

Take a look at the list function below.it is your originnal code corrected with comments

var list = function(friends){
    //here you uses Object as your iterable
    //but Object is not defined
    //it should rather be friends
    //since it is the the parameter used in the function definition
    //not this friends argument has nothing to do the friends object created before
    // to the function
    for(var firstName in friends){
        console.log(firstName);
    }
};

list(friends);

#3

Solved!

Thanks a lot!