Adding properties 4


#1

https://www.codecademy.com/courses/javascript-beginner-en-3bmfN/0/4?curriculum_id=506324b3a7dffd00020bf661

SyntaxError: Unexpected identifier


var friends = {

bill: {
  firstName:"Bill",
  lastName: "Gates",
  number: "(123) 456-7890",
},

steve: {
  firstName:"Steve"
  lastName: "Jobs",
  number:"(123) 456-7890",
};


#2

you need a comma after "Steve"


#3

thanks, i added the comma. still having a problem....

var friends = {

bill: {
firstName:"Bill",
lastName: "Gates",
number: "(123) 456-7890",
},

steve: {
firstName:"Steve",
lastName: "Jobs",
number:"(123) 456-7890",
};


#4

I got it now!!

var friends = {

bill: {
firstName:"Bill",
lastName: "Gates",
number: "(123) 456-7890",
},

steve: {
firstName:"Steve",
lastName: "Jobs",
number:"(123) 456-7890",
}
};


#5

Good! happy coding! :smiley:


#6

or I've done it this way:

var friends = new Object(); {

friends.bill = new Object(); {
    friends.bill.firstName = 'Bill',
    friends.bill.lastName = 'Jo',
    friends.bill.number = '123'
    };

friends.steve = new Object(); {
    friends.steve.firstName = 'Steve',
    friends.steve.lastName = 'McOuo',
    friends.steve.number = '789'
    };


};

#7

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.