30/33 Bug?


#1

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

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

My Error
Oops, try again. Make sure that spencer and spencer2 have the same value for age


#2

You can't just put age:22
You have to put it as "spencer2.age = 22;"
The same goes for country


#3

Indeed, remember that DOT notation is different from the original notation.

Eg.

DOT NOTATION

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

vs

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

#4

Ah! Thank you very much, such a simple fix.

Thanks again.


#5

Also need to ensure that you place new before Object()

as in:

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


#6

I did my well, I was given the same mistake and now this right.

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

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

console.log(spencer2)