4. Adding properties- Syntax Error


#1

I'm having difficulty with the syntax problem when defining the keys of the new objects. Can someone take a look and see where my syntax is going wrong?

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

Syntax Error: Unexpected Token

var friends = {
  bill: {};
      firstName: "Bill",
      lastName: "Gates",
      number: "(514) 555-5555"
      
  steve: {};
      firstName: "Steve",
      lastName: "Jobs",
      number:"(514) 566-5555"
};

#2

Write the properties inside the braces.


#3

Tried these variations, they didn't work.

1)
var friends = {
bill: {};
firstName: {"Bill"},
lastName: {"Gates"},
number: {"(514) 555-5555"}

steve: {};
firstName: {"Steve"},
lastName: {"Jobs"},
number:{"(514) 566-5555"}
};

2) 1)
var friends = {
bill: {
firstName: "Bill",
lastName: "Gates",
number: "(514) 555-5555"
};
steve: {
firstName: "Steve",
lastName: "Jobs",
number: "(514) 566-5555"
};


#4

The second variation is the one that should work (with one minor fix). The first is way off the mark.

The fix is to change the semi-colon to a comma after the bill object.


#5

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