What is wrong in my code?


#1


30. What Are Objects For?


I get this message and I don't get why :frowning::
"Oops, try again. Make sure to use the Object constructor."


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

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


#2

remove space between Object  and ()

Object()

#3

Thank you very much!


#4

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