30. What are objects for


I need help it says they don't have the same age value but I could have sworn 22 is = to 22


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();
spencer.age = 22;
spencer.country = "United States"


Be sure to use the correct variable name.


I am having similar problem here:

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

error message says:make sure to use object constructor, i cannot find the error


Maybe you shouldn't put a space in between object and ();???


1) Space between Object and ()
2) semicolon is missing after "United States"


Not necessarily... you don't need a semicolon if you make each line of code on a different line. If you crammed all of your code on one line you would need semicolons. Here is what @mtf said about it.


Yeah, I know. JS got ASI (Automatic Semicolon Insertion). But the JS engine on CA is sometimes picky. That's at least has been my experience.


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