List 'Em All!


#1


Hi, I'm getting this error when trying to log the firstnames of my list.

"Error: Did you create a function called list?"

Could someone help? Thanks.

var friends = Object();

friends.steve = {
    firstName: "Steve",
    lastName: "Smith",
    number: 777,
    address: ["2","far"],
    };
    
friends.jayjay = {
    firstName:"Jordan",
    lastName: "Dean",
    number: 333,
    address: ["3", "imaginary road"],
    };

friends.bill = {
    firstName: "Bill",
    lastName: "Baggins",
    number: 222,
    address: ["4","boring road"],
    };
    
var list = function (friends) {
    for (var key in object) {
        console.log(friends[key]);
    };
};


#2

Ho this

for (var key in object)

line It should be key in friends


#3

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