Contact List debug


Guys, my code says "Oops, try again. It looks like your friends don't have the firstName property" I've checked and checked and can't figure it out... it may be the dim light :wink:

help me debug this please.

var friends = new Object();

    friends.bill = new Object();
        bill.number="(206) 555-555";

    friends.steve = new Object();
        steve.number="(205) 666-666";


You making 3 objects here, when you are supposed to add contacts to one object called friends . You need to do something like this.

var friends = {};

    friends.bill = {
  firstName: "Bill",
  lastName: "Gates",
  number: "(206) 555-5555", }

    friends.steve = {
    firstName: "Steve",
    lastName: "Jobs",
    number: "(205) 666-666", }


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.