5. Tossing in an array


#1

My code is:

var friends = {
one: 'bill',
two: 'steve',
};

friends.bill = {
firstName: 'Bill',
lastName: 'One',
number: 949529939,
address: ['First','address','Bill']
};
friends.steve = {
firstName: 'Steve',
lastName: 'Two',
number: 948589293,
address: ['Second','address','Steve']
};

What's wrong? I get the "Oops, try again. Did you give each of your friends an address property?" message.


#2
var balls = {
  one: 'red',
  two: 'blue'
}

If we want to make an object for the red ball, we'd use this:

balls.one = {
  bouncyness: 'Very high'
}

When you do this, you should always use the properties of the object, not their values.


#3

When I do exactly what they say:

var friends = {};

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

friends.steve = {
firstName: "Steve",
lastName: "Jobs",
number: "(408) 555-5555"
address: ["1 Infinite Loop","Cupertino","CA","95014"]
}

It says: SyntaxError: Unexpected identifier

Help!


#4

FIXED: I added a comma!

NO 2 COMMAS!