Tossing in an array - "Did you give your friends an address property?"


#1

`var friends = {
Friend: 'Friend'
};
friends.bill = new Object();
friends.steve = new Object();

friends.bill.firstName = "Bill";
friends.bill.lastName = "Nye";
friends.bill.number = 7;
friends.bill.address = ['Somewhere', 'A Place'];

friends.steve.firstName = "Steve";
friends.steve.lastName = "Fox";
friends.steve.number = 1;
friends.steve.address = ['Somewhere', 'A Place'];`

My code runs fine but it doesn't see the address property.


#2

Your friends object currently has 3 objects inside of it. Bill and Steve are fine, but you created another named Friend when you declared friends. Remember, both

var friends = new Object();

or

var friends = {
   bill:{ 
       (first, last, etc.)
   }
   steve:{
       (first, last, etc.)
   }
}

are valid ways of declaring objects. When you have Friend:'Friend', you are adding an extra object you didn't mean to.