6. List 'em all!


#1


https://www.codecademy.com/en/courses/javascript-beginner-en-3bmfN/0/6?curriculum_id=506324b3a7dffd00020bf661


I get the error "Oops, try again. It looks like your list function isn't printing the right output."
I'm not understanding how to do the list function or what i have done wrong. I will be eternally grateful to anyone who points out my ignorance.


var friends = {
    andreas: {
        firstName: "Andreas",
        lastName: "Marprotos",
        number: 0735754589,
        address: ["breckvegen 11", "sundbyberg", "sverige", "16634"]
        }
        };

friends.bill = {
    firstName: "Bill",
    lastName: "Billson",
    number: 0705649089,
    address: ["onestreet", "Redmond", "CA", "98052"]
    };
friends.steve = {
    firstName: "Steve",
    lastName: "Schteve",
    number: 1234567890,
    address: ["liveshere street", "madeup", "somestate", "88123"]
    }; 
    
    var list = function(friends) {
        for (var bajs in friends) {
            console.log(friends[bajs]);
        }
    };


#2

you only need to log bajs to console (which contains bill, andreas and steve)


#3

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