Java>Arrays and Obj Construct/Linear


#1

https://www.codecademy.com/en/courses/javascript-beginner-en-9Sgpi/2/4

Literally, what is wrong. Do I have to log the different names? Use ".name"? Make them strings? What in the actual..


#2

var object1 = ...


#3

We asked to create three objects,

var object1 = ... etc
var object2 = ... etc
var object3 = ... etc.

Edit: took too long to type; leaving it anyway.


#4

Now do I use these to declare the objects and then do the syntax afterwards?


#5

I don't think that's how you create an object. Look closer at those examples.


#6

I know I'm missing the point..I grasp that..I just don't understand WHAT to make object 1, 2, etc...


#7

What needs to be an object is what I'm confused on...I've tried several combinations.


#8

Here are some examples:

var object1 = new Object();
object1.name = "Joann";
object1.age = 45;

var object2 = {};
object2.town = "Tampa";
object2.year = 2015;

var object3 = {
    dressing: "Ranch",
    quantity: 40
}

Note the literal syntax in the last one.


#9

You should create a variable named object 1

like this:

var object1 = 5

Although that's not the right value. You should assign an object to that name.

And then there are two more names I believe?


#10

Ahhhhhh I see you have to make the variable the "object*1*,2" . Ok..I get it now. Thank you so much!


#11

not myObj....that makes more sense now