4. Adding properties


#1


Is it okay if ill use such type of code? I find it more logical, than that one in the hint. Which way to create such a list ist "Standart"?

var friends = {};
friends.bill={};
friends.bill.firstName="Bill";
friends.bill.lastName="tt";
friends.bill.number=123;
friends.steve={};
friends.steve.firstName="Steve";
friends.steve.lastName="qq";
friends.steve.number=456;
console.log(friends.bill.firstName+" "+friends.bill.lastName+" "+friends.bill.number)


#2

In the short and long run, less verbosity is our main goal. Not sure what is in the hint, but if it looks like this,

var friends = {
    bill: {

    },
    steve: {

    }
};

then the author is not misleading us.


#4

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