My code went through, but im not sure if its actually RIGHT. HELP!


#1

My code looks so simple compared to everyone else's code. It says its right but I'm not sure if its actually RIGHT.

var object1 = {
    hi: 'awkward',
    
}
var object2 = {
    hello: 'firm',
    
}

var object3 = {
sup: 'comfortable',

}

#2

Hello @tropicaltaquito,

What exercise are we looking at? Syntax-wise, your code does look fine. Although, a semi-colon ( ; ) at the end of each object created won't be bad. :slight_smile:


#3

It's the 12th lesson


#4

Okay, the instruction says:

Create three objects called object1, object2, and object3 in the editor. Use either literal notation or the object constructor, and give your objects any properties you like!

I will use the object constructor approach with your example.

var object1 = new Object();
var object2 = new Object();
var object3 = new Object();
object1.hi = "awkward";
object2.hello = "firm";
object3.sup = "comfortable";

Literal notation will be thus:

var object1 = {}
var object2 = {}
var object3 = {}

object1.hi = 'awkward';
object2.hello = 'firm';
object3.sup = 'comfortable';

#5

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