CA says it,s ok, but code works wrong


#1

var friends = {
bill: {
firstName: "Bill",
lastName: "Chan",
number: "12 345 678",
address:['street32','cityq','NY','swedwe']
},
steve: {
firstName: "Steve",
lastName: "Jackson",
number: "7777 7777 7777",
address:['street42','cityf','sw','dwgtfr2']
}
};

var list = function (friends){
for(var lastName in friends){

    console.log(lastName);

    }

}

It should be log last names, but it is not. What is wrong? Thank You.


#2

Try

for(lastName in friends){

#3

unfortunately it does not work ...


#4

I don't know then, sorry!


#5

Thank You for trying :grinning:


#6

Ok, I found solution.