Contact list 12


#1

Hello, I am having some problems in my code

It is Contact list 12 in unit 7 of JS

The error message is "Syntax error: Unexpected identifier"

here is my code

var friends = {
        bill: {
        firstName: "Bill",
        lastName: "LLib",
        number: "(101) 101-1101"
        }
        steve: {
        firstName: "Steve",
        lastName: "Evets",
        number: "(111) 111-1111"
        }
         JOHN: {
        firstName: "John",
        lastName: "Nhoj",
        number: "(212) 888-9871"
        }
        BillyBobJoe: {
        firstName: "BillyBo",
        lastName: "Bjoe",
        number: "(434) 897-9387"
        }
    };

#3

You're missing the commas in the first Object.

var friends = {
        bill: {
        firstName: "Bill",
        lastName: "LLib",
        number: "(101) 101-1101"
        }, //You need one here
        steve: {
        firstName: "Steve",
        lastName: "Evets",
        number: "(111) 111-1111"
        }, //Here
         JOHN: {
        firstName: "John",
        lastName: "Nhoj",
        number: "(212) 888-9871"
        },//And here
        BillyBobJoe: {
        firstName: "BillyBo",
        lastName: "Bjoe",
        number: "(434) 897-9387"
        }
    };

#4

ok thanks! :grin: It helped me


#5

I don't understand, where is my mistake about this message:
"Did you create a function called list?"

var friends = {

bill: {
firstName:"Bill",
lastName:"Gates",
number:"(206) 555-5555",
address: ['One Microsoft Way','Redmond','WA','98052']
},

steve: {
firstName:"Steve",
lastName:"Jobs",
number:"(602) 333-4444",
address: ['1 Infinite Loop','Cupertino','CA','95014']
},
};

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


#6

console.log(bill.firstName);