30. What Are Objects For?


#1

Been staring at this for a while now...

Here are the instructions for the lesson:
Make a new object, spencer2, with the same properties but using constructor notation and the Object constructor.


Here is the error message I'm getting:
Oops, try again. Make sure to use the Object constructor.

What am I doing wrong?

var spencer = {
  age: 22,
  country: "United States"
};

// make spencer2 here with constructor notation
var spencer2 = new Object;
spencer2.age = 22;
spencer2.country = "United States";


#2

I figured it out... ( ) was needed after "new Object".

here is the working code.

var spencer = {
  age: 22,
  country: "United States"
};

// make spencer2 here with constructor notation
var spencer2 = new Object();

spencer2.age=22
spencer2.country="United States"