Creating a new object --


#1

Recreate your me object in the editor, but this time, use the object constructor. Once you make it, use either the [] notation or the . notation to give it a name property with a string value (your name) and an age property with a number value (your age).

What is going on with my code!! it is showing

SyntaxError: Unexpected token .
`
Please HELP! :frowning:

var me = new Object();
var me["name"] = "Mou";
var me.name : "Mou";


#2

Replace the " : " after me.name with " = "


#3

Hi here the two structure of a object

var myObject = {
    name: "Frank",
    age: 0
}

or 

var myObject = new Object();
    myObject['name'] = "Franck";
    myObkect.age = 0

in yours

var me = new Object();
var me["name"] = "Mou";
var me.name : "Mou";

like @i_tried said change the : to = then remove the var before

var me["name"] = "Mou";
var me.name : "Mou";

and they aske you to gave the name and the age


#4

Oh got it man!! :smile:
thanks!
it will just be

var me = new Object();
me["name"] = "Mou";
me.age = 21;

i just needed to remove var becauser i called tht before! :innocent:


#5

its , because they are the propriety of your object