3/8 Adding your friends Unexpected Token?


#1

var friends = new Object();
friends[bill]= new Object();
bill.name={"Bill"};
friends[steve]= new Object();
steve.name={"Steve"};

Tells me "SyntaxError: Unexpected token }"
Not sure what that means, can someone please explain.


#2

The problem is caused by these two lines:

bill.name={"Bill"};
steve.name={"Steve"};

Do you know why?


#3

I can't say I do. Please explain.


#4

You are trying to add the values "Bill" and "Steve" as objects, but they should be string keys to firstName.


#5

Oh Now I get it. Ok thank you very much for your help!