What Are Objects For?


#1

I am pretty sure this code is right but I get an error: Oops, try again. Make sure that spencer and spencer2 have the same value for age ?

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

Maybe you should change:

var Spencer2 = new Object();
Spencer2.age = 22;
Spencer.country = "United States";

to

var spencer2 = new Object();
spencer2.age = 22;
spencer.country = "United States";


#3

Yes, the console is looking for an exact value match under the variable name "spencer2" so it would have to look like this.

var spencer2 = new Object();
spencer2.age = 22;
spencer2.country = "United States";