What is wrong ? help me


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


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;


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.


Oh sorry i forgot about that sorry :disappointed:


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

me.age = 43;

i used both the process