Stuck on 5/8 (Tossing in an Array) and don't know why


#1

Been trying to find the bug here...

var friends = {};
sis: {
firstName: "isha",
lastName: "Shah",
number: "(732) 762 7559",
address: ['One Microsoft Way','Redmond','WA','98052'] }
kavita: {
firstName: "kavita",
lastName: "Gajjar",
number: "555-555-5555",
address: ['One Microsoft Way','Redmond','WA','98052'] }
bill: {
firstName: "bill",
lastName: "gates",
number: "888-999-0000",
address: ['One Microsoft Way','Redmond','WA','98052'] }
steve: {
firstName: "steve",
lastName: "jobs",
number: "777-888-9999",
address: ['One Microsoft Way','Redmond','WA','98052'] }
};


#2

FYI - also tried it this way:

var friends = {
sis: {
firstName: "isha",
lastName: "Shah",
number: "(732) 762 7559",
address: ['One Microsoft Way','Redmond','WA','98052']}
kavita: {
firstName: "kavita",
lastName: "Gajjar",
number: "555-555-5555",
address: ['One Microsoft Way','Redmond','WA','98052']}
bill: {
firstName: "bill",
lastName: "gates",
number: "888-999-0000",
address: ['One Microsoft Way','Redmond','WA','98052']}
steve: {
firstName: "steve",
lastName: "jobs",
number: "777-888-9999",
address: ['One Microsoft Way','Redmond','WA','98052']}
};


#3

Hi, every person in your friends Object should be separated by a particular sign. Here is an example from the Glossary that should help you:

Example:


var obj = {
name: "Bob",
married: true,
"mother's name": "Alice",
"year of birth": 1987,
getAge: function () {
return 2012 - obj["year of birth"];
},
1: 'one'
};

BTW: in your second code you corrected a mistake from the 1st one of having a }; signs, which indicated that var friends are already closed. good for you for spotting it.


#4

Hi,

Getting back on this. Not sure where the sign is here. Also, why are some categories like mother's name string while others like married are not?


#5

Nvm - Found out I needed a comma at the end of each person's info - at the end of the address "]}"