Help please output not expected


#1

var friends =new Object();
friends.bill =new Object() ;
friends.bill.firstName = "Bill";
friends.bill.lastName = "Smith";
friends.bill.number = "780-686-5396";
friends.bill.address = ['78, haney court']
friends.steve =new Object() ;
friends.steve.firstName = "Steve";
friends.steve.lastName = "Smith";
friends.steve.number = "780-878-5396";
friends.steve.address = ['58, rose street']
friends.will =new Object() ;
friends.will.firstName = "William";
friends.will.lastName = "Smith";
friends.will.number = "545-575-8989";
friends.will.address = ['25, candylane']

the output is [25,candylane]


#2

As you can probably see, what you are doing is a LOT of work.

var pets = new Object();
pets.dog = {
  name: 'Doggeh',
  age: 6,
};
pets.cat = {
  name: 'Kitteh',
  age: 2,
}

Try this, it should help a lot.

Also, you put the values in the address arrays in one string, so it's not really an array anymore. Try doing for example:

pets.fish = {
  name: ['Blub', 'Bulb', 'Blublub'],
  age: [2, 3, 1],
}

Hopefully this solves your problem. If it doesn't, please tell me.