Am I Not Allowed to Mix Object Types?


In this exercise, we're adding objects within an object. We're allowed to add objects directly or use an object constructor. I'm trying to practice both so I tried to make the outer object directly and the inner objects using an object constructor, but this keeps coming up with a syntax error. Is it against the rules to use two different types of objects mixed in together like this, or am I just doing it wrong?


You're trying to use dot-notation inside constructor notation. Also, I would reccommend you make them objects like this:

var friends = {
Paul = {};
Leanne = {};
Mom = {};

Another Way:

var friends = new Object();
friends.Paul = {};
friends.Leanne = {};
friends.Mom = {};