12.Practice makes prefect question


#1



Not exactly sure how this is incorrect. Could someone help?


var object1 = new object(); {
object1.name = "Amora",
object1.friend = "Matthews",
object1.age = 78
};
var object2 = new object(); {
object2.age = 34,
object2.sister = "Alexis",
object2.brother ="Josiah"
};
var object3 = new object(); {
object3.mother = "Inez",
object3.father = "Emil",
object3.date = "May"
};
var object{};


Replace this line with your code.


#2

Next time, a link to the lesson would be helpful :slight_smile:

May I suggest reviewing the literal and constructor syntax in the Hint section? Perhaps you are unnecessarily combining elements of each...? :wink:


#3

There is two way to create an object uses object literal notation—that is, creating a new object with { } and defining properties within the brackets.
example:

var susan1 = {
name: "Susan Jordan",
age: 24
};

Another way of creating objects without using the curly brackets { } is to use the keyword new. This is known as creating an object using a constructor.
example:

var susan2=new Object();
susan2.name="Susan Jordan";
susan2.age=24;

now its upto you what do you want to use.if you want second one then remove all the { } bracket. :slight_smile:


#4

Thanks for your responses but,
I still cannot understand why it says, "object not defined" and "did you make object1 an object?"

var object1 = new object();
object1.name = "Amora";
object1.friend = "Matthews";
object1.age = 78;

var object2 = new object();
object2.age = 34;
object2.sister = "Alexis";
object2.brother ="Josiah";

var object3 = new object();
object3.mother = "Inez";
object3.father = "Emil";
object3.date = "May";

The link: https://www.codecademy.com/courses/javascript-beginner-en-9Sgpi/2/4?curriculum_id=506324b3a7dffd00020bf661#


#5

line# 1, 6, and 11

For new object();, "O" should be a capital letter. For instance:

var object1 = new object(); << this should be as follow:
var object1 = new Object();