-1

I've been trying Codeacademy and im at a task where you make a contact list and here below is my code i've written. But it keeps getting the error " Oops, try again. Did you give each of your friends an address property?" And i do not know what to do.. I tried posting this issue at the forum of the task, but there were no working solution to fix this.

var friends = new Object();
friends.firstName = "George";
friends.lastName = "Georgsson";
friends.number = 5555555;
friends.address = ["Street streetsson" , "9011010", "Redmond"];


friends.bill = new Object();

friends.bill.firstName = "Bill";
friends.bill.lastName = "Gates";
friends.bill.number = 132123123;
friends.bill.address = ["Microsoft Corporation" , "9011010", "Redmond"];



friends.steve = new Object();
friends.steve.firstName = "Steve";
friends.steve.lastName = "Jobs";
friends.steve.number = 51515151;
friends.steve.address = ["Apple Inc", "9011010", "Redmond"];
6
  • With the code you provided, this is impossible to debug. Commented Jul 31, 2015 at 18:08
  • can you post a link to the question, or quote the requirements and any code that was originally given? Commented Jul 31, 2015 at 18:09
  • You may want friends to by an array and then push george, bill, and steve in Commented Jul 31, 2015 at 18:10
  • The issue may be that you made friends an object, and you assigned the information for George to that object instead of to friends.george. Commented Jul 31, 2015 at 18:12
  • Cannot say for sure without seeing the problem, but why are you assigning George to the friends object itself, instead of friends.george? Commented Jul 31, 2015 at 18:14

1 Answer 1

1

This is what I had to do on that module. I just filled it in with random data below, but that should work for you. I only used 2 friends, i think that's all you need.

var friends = new Object();

friends.bill = {
firstName:"Bill",
lastName:"Scuba",
number:12,
address:["lol",2]
}

friends.steve = {
firstName:"Steve",
lastName:"Scuba",
number:12,
address:["lol",2]
}
Sign up to request clarification or add additional context in comments.

1 Comment

Hello, I removed the whole "George" code piece, and it works now, dont know why it did not work with it tough, but thanks!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.