What are objects for? (Needs Debugging)


#1


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

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


#2

after you defined this object..

var spencer2 = new Object();

You have to use dot notation to add key: value pairs to your object spencer2..

Like adding age..

spencer2.age = 22;

same way add country key and its corresponding value .

one more thing..
Read the theory and instruction again.


#3

I had the same problem @dragon_king001


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.