4.Adding Properties


Here is my code:

var friends = {
bill: {
firstName: "Bill",
lastName: "Gates",
number: "(206) 555-5555"
steve: {
fistName: "Steve",
lastName: "Jobs",
number: "(408) 666 6666"

I am pretty sure I have done what it asked me but its getting: SyntaxError: Unexpected identifier.

Could anyone help me out with what I am doing wrong here?


add a comma before this line right after this


I was having the same problem too, but adding a comma after this block solved it:

bill = {

Thanks @rydan.


Why does putting a comma there fix it? the example that they give you doesn't have a comma. Maybe I am missing the point there.


Because each key and value needs a comma unless its not the last key.
here, "friends " object's first key is bill and next is steve.
So, a comma is required after bill.


Think of it in these terms:

var friends = {
    bill: {},
    steve: {},
    ada: {}