30 what are objects for?


what's wrong with my code, i am getting the error message as
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();
this.age = 22;

Continuing the discussion from 30 what are Objects for?:


change this.age =22 to spencer2.age = 22;
And add spencer2.country = "United States";

And I think that will work


thanks now it works fine