Contact list, 4. Adding properties


The error message says, "It looks like your friends don't have the firstName property." Thanks for the help.

var friends= new Object();
    friends.bill= new Object(); {
        Object.firstName= "Bill";
        Object.lastName= "Gates";
        Object.number= "(309) 555-5555";
     friends.steve= new Object(); {
        Object.firsName= "Steve";
        Object.lastName= "Jobs";
        Object.number= "(308) 444-4444";


The problem is that you aren't suppose to use dot notation; your writing the object in curly braces right? (the the name for the type of object escapes me right now). So what you should do is say firstName: "something" and do that with the rest of your code as well. Don't use the = sign in this type of object constructor, remember to use the colon instead. Also, don't say new Object, because you aren't using dot notation, instead just say,

var something = {
something: {


somethingElse: {



You are using both the notations together. Use one of them.
var friends=new Object();
friends.bill=new object();
so on

var friends={


Thank you, javaninja03847.


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