What is wrong with my code ? Creating a new object


#1



Creating a new object

ReferenceError: object is not defined Oops, try again. Did you create your object using the object constructor?


var myobj = new object();
my.name= "vasilis";
my.age= 53;

`


#2

o should be capital

Object();

and
as varibale name is myobj so it should be

myobj.name= "vasilis";
myobj.age= 53;


#3

is not working
var myObj = new ╬čbject();
myObj.name= "vasilis";
myObj.age= 53;

Oops, try again. Did you create an object called me


#4

your code is fine.but it'll not work.because you are told to create an object called me.so it should be

var me = new ╬čbject();
me.name= "vasilis";
me.age= 53;

me is just name of the variable.


#5

thank you .You are rigth


#6

Hello,

I have the same format for my code and I am getting an error, since the task is to recreate me, how do you write this so it will go through? Thanks.

var me = new object();
me.name = "Cheryl";
me.age = 61;


#7

o for object should be capitalized as @rcodeman puts it.


#8

Ok thank you, I did get that fixed.


#9

hello,

I just wondering why it only shows my age instead of name and age when I wrote my code like this :

var me = new Object();
me.name="Adam"
me.age=20


#10

I'm not exactly sure, but try putting a semicolon (:wink: after "Adam" and 20.


#11

Oops. The computer interpreted :wink: as an emoji. It was supposed to be ; )