5. tossing arrays....... what am i doing wrong?


#1

var friends = {
location: 'California',
date: 'Friday'
};
var friends = new Object();
friends["location"] = "California";
var friends = new Object();
var friends = new Object();

friends.bill = {
firstName: "Bill",
lastName: "Gates",
number: "(206) 555-5555"
address: ['One Microsoft Way','Redmond','WA','98052']
};

friends.steve = {
firstName: "Steve",
lastName: "Jobs",
number: "(101) 222-3303"
address: ['One Microsoft Way','Redmond','WA','98052']
};

it says i have a syntax error what is it?


#2

Objects are constructed from key: value pairs, we use commas to separate these pairs.

In the friends.bill and friends.steve objects you have to add commas after values of the number property.

friends.bill = {
  firstName: "Bill",
  lastName: "Gates",
  number: "(206) 555-5555" // <-- here
  address: ['One Microsoft Way','Redmond','WA','98052']
};

#3

Thank you the problem is fixed now


#4

You're very welcome :slight_smile:


#5

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