30: What are Objects for?


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

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

it's telling me I'm not using constructor notation and I am I'm so confused


Hey @nbhavs! Just a simple fix! You have an unnecesary space between Object and ();


Do it like this:

var spencer2 = new Object();

Hope that helped!


that solution worked thanks!


No Problem @nbhavs! Any Time!


I had this same problem and the same solution worked–but now I'm curious. Why does it matter whether or not I use an extra space?


I console logged it and the object still worked I think it's just code academy messing up