Contact List


#1

Ok so in the JS course in the Contact List I didn't like how they organized it, so I did it like this:
tristin = {
firstName: "Tristin",
lastName: "Galagher",
number: "555-345-7548",
address: ["One Microsoft Way", "Snohomish", "WA", "98233"]
};
demarko = {
firstName: "Demarko",
lastName: "Gonzalez",
number: "555-489-3256",
address: ["Two Microsoft Way", "Snohomish", "WA", "98343"]
};
ben = {
firstName: "Ben",
lastName: "Bosely",
number: "555-489-3256",
address: ["Three Microsoft Way", "Snohomish", "WA", "95633"]
};
jeremy = {
firstName: "Jeremy",
lastName: "Sturm",
number: "555-345-7548",
address: ["Four Microsoft Way", "Snohomish", "WA", "98263"]
};
aiden = {
firstName: "Aiden",
lastName: "Pitt",
number: "555-873-2348",
address: ["Five Microsoft Way", "Snohomish", "WA", "92314"]
};
friends = [tristin, demarko, ben, jeremy, aiden];
list = function() {
for(var i = 0; i < friends.length; i++) {
console.log(friends[i].firstName);
}
}
The list function is working but it returns this
Tristin
Demarko
Ben
Jeremy
Aiden
Did I have to use steve and bill?
Or is it because I did it different?
Am I just screwed and have to restart?
Please help!


#2

if you have to use bill and steve, you do not have to restart(that's the whole point of modularity). You just have to add then to the friends object and comment out the rest just for the testing purposes and then add them back in after