What is wrong ? help me


#1

var me = new Object();
var myObj["name"] = "yong jin";
var myObj.name = "yong jin";
var myObj.age = 43;


#2

Hey @ecln30! First of all you dont need all those variables delete all those code that start with var. With the exeption of that everything is right! It should work, If it dosent pls reply saying so!

Again, Your code:

Correct code:

var me = new Object();
myObj["name"] = "yong jin";
myObj.name = "yong jin";
myObj.age = 43;

#3

Use the new object me when you are adding new properties. There is no need to use myObj.

The code:

is not correct, because myObj is undefined.


#4

Oh sorry i forgot about that sorry :disappointed:


#5

its suppose tobe like this....
var me = new Object();
me["name"] = "yong jin";

me.age = 43;

i used both the process