6. List 'em all!


#1

Hi all,

When I post my code it gives me bill, steve and henry, rather than Bill, Steve and Henry but yet I am able to move on. Can someone please explain what I am doing wrong.

Thank you

var friends =
{
    bill: 
    {
        firstName: "Bill",
        lastName: "Gates",
        number: '077027882324',
        address: ['One Microsoft', 'One Lane', 'SF']
    },
    
    steve: 
    {
        firstName: "Steve",
        lastName: "Jobs",
        number: '63473483',
        address: ['One Apple', 'One Apple Lane', 'SF']
        
    },
    henry: 
    {
        firstName: "Henry",
        lastName: "Dott",
        number: '234234234234',
        address: ['One London', 'London Lane', 'UK']
    }
};

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

#2

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