Contact List Q&A


#1

Hello every one. I am having a problem on 2/8 and I am hoping someone could help me :sweat_smile:. The editor tells me that...SyntaxError: missing : after property id. Here's my code:


 var friends = {
    Bill = {
      firstName: "Bill",
      lastName: "Gates",
      number: "(206) 555-5555",
      address: ['One Microsoft Way','Redmond','WA','98052']
    };
    Steve = {
      firstName: "Steve",
      lastName: "Jobs",
      number: "(408) 555-5555",
      address: ['1 Infinite Loop','Cupertino','CA','95014']
    };
    };

Thank you in advance!


#2

I see your issue @camillita. You see var friends is an object just like Bill and Steve are, which means what? We need commas after we make the keys and values in the object. Now basically what I am saying is after

address: ['One Microsoft Way','Redmond','WA','98052']
};

Add a little comma after the "};" that should fix your problem.


#3

@claradavies, I tried putting a comma after the }; but it didn't work. Must be something else. Thanks though!


#4

@camillita Shouldn't you be using a ':' instead of '=' while defining a key?

Instead of 'Bill =' try 'Bill:'


#5

You should use lower-case names for objects inside friends and than upper-case names in firstName.


#6

Okay...we're getting somewhere. Now the editor is telling me: SyntaxError: missing } after property list. This is what my "updated" code is looking like:

var friends = {
bill: {
  firstName: "Bill",
  lastName: "Gates",
  number: "(206) 555-5555",
  address: ['One Microsoft Way','Redmond','WA','98052']
};
steve: {
  firstName: "Steve",
  lastName: "Jobs",
  number: "(408) 555-5555",
  address: ['1 Infinite Loop','Cupertino','CA','95014']
};
};

Thanks


#7

Remove the ; after your }

It should just be a comma.

var friends = {
    bill: {
        firstName: "Bill",
        lastName: "Gates",
        number: "555 - 5555",
        address: ['One MS Way', 'Redmond', 'WA', '98052']
    },
    steve: {
        firstName: "Steve",
        lastName: "Jobs",
        number: "123 - 1111",
        address: ['One Circular Way', 'Cupertino', 'CA', '90212']
    }
};

#8

Here try making your code look like this

 var friends = {
    Bill = {
      firstName: "Bill",
      lastName: "Gates",
      number: "(206) 555-5555",
      address: ['One Microsoft Way','Redmond','WA','98052']
    },
    Steve = {
      firstName: "Steve",
      lastName: "Jobs",
      number: "(408) 555-5555",
      address: ['1 Infinite Loop','Cupertino','CA','95014']
    }
    };

#9

Thanks folks (@irishbeginner88 @claradavies @tagmaster27309 @rejowid )!!!!!!!!!!!!!!!!! It worked. And.... I'm happy!