Unexpected Identifier


#1

I don't see what's missing... can you?

var friends ={
Bill: {
firstName: "Bill",
lastName: "Murray",
number: "335678983748",
address: ["Monterrey", "34409"]

},
Steve: {
firstName: "Steve",
lastName: "Wonders",
number: "335678983748",
address: ['Coahuila', "89475"]
},


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

};

list(friends);

#2

Can you link the error message please?


#3

SyntaxError: Unexpected identifier


#4

Alright, Try this.

instead of:

Bill: { }

try.

friends.Bill = { }
friends.Steve = { }

Hope this helps


#5

Returns unexpected token instead.


#6

with:

var friends = { };

close that bracket on the first line instead of putting bill and steve inside of it.

You're calling bill and steve and having them add themselves inside of the friends object. This is confusing the program.

so have this:

var friends = { };

then

friends.Bill {...};
friends.Steve = {...};

#7

Thanks! Worked, although it should have worked the other way too.