Literal function notation not working


#1


Hi all, I have created a function in literal notation inside the friends object. Why is this not being approved? :frowning: Many thanks


var friends = {
   bill: {
       firstName: "Bill",
       lastName: "Danielsen",
       number: 065858,
       address: []
       },
   steve: {
        address: []
       },
    list: function(friends) {
        for (var i in friends) {
        console.log(i);
        }
    }
};

friends.list();


#2

the friends object should only contain friends (bill and steve, and more if you like) the list function should just be a regular function after the object


#3

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