4. Adding Properties


#1

Hey can someone please tell me what is wrong with this?

It is telling me:

SyntaxError: Unexpected identifier 'steve'. Expected '}' to end a object literal.

var friends = {
    bill: {
        firstName: "Bill",
        lastName: "Gates",
        number: "206-555-5555",
    }
    steve: {
        firstName: "Steve",
        lastName: "Jobbs",
        number: "306-555-5555"
        }
    ariana: {
        firstName: "Ariana",
        lastName: "Trafford",
        number: "905-555-5555"
        }
};


#2

HI you should add a , after each object inside friends

    bill: {
        firstName: "Bill",
        lastName: "Gates",
        number: "206-555-5555",
    },
  ....

do the same after steve


#3

var friends = {
bill: {
firstName: "Bill",
lastName: "Gates",
number: "206-555-5555",
}
steve: {
firstName: "Steve",
lastName: "Jobbs",
number: "306-555-5555",
}
ariana: {
firstName: "Ariana",
lastName: "Trafford",
number: "905-555-5555",
}
};

still same error:
SyntaxError: Unexpected identifier 'steve'. Expected '}' to end a object literal.


#4

I mean like that

var friends = {
    bill: {
        firstName: "Bill",
        lastName: "Gates",
        number: "206-555-5555",
   }, //add this
    steve: {
        firstName: "Steve",
        lastName: "Jobbs",
        number: "306-555-5555",
   }, //add this
    ariana: {
        firstName: "Ariana",
        lastName: "Trafford",
        number: "905-555-5555",
   }, //add this
};

read the comment


#5

Worked! Thank you so much!


#6

Hallelujah! Worked with me too!!! Would never come to that idea :slight_smile: Thanks!!!


#7

Thanks! Worked for me too :slight_smile: