I don't understand what I am doing wrong. Contact List exercise


#1


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


It is giving me a syntax error. Not sure what I am doing wrong.


var friends = 
{
    bill:
    {
        firstName: "Bill",
        lastName: "Gates",
        number: "425-654-0084",
        address: ["Redmond, WA"]
    },
    steve: 
    {
        firstName: "Steve",
        lastName: "Jobs",
        number:"253-576-9975",
        address: ["USA"]
    }
     var list = function (friends)
    {
        for(var key in friends)
        {
            console.log(key);
        }
    };
};


#2

The problem is your list function should not be inside your var friends. Close out your friends variable before the function.


#3

it is syntax error:
before "var" close your object " };" and dont need ";" for both } at the end of your code


#4

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