11. Creating a new object


#1

var me = new Object();
me["name"] = "Aaleah";
me["age"] = 16;
};

It says that there was a problem with your syntax


#2

You've got a } but no {

If there are more syntax problems I suggest removing parts until it runs, when it does you'll have removed something problematic and you'll know what to look closer at.


#3

that worked! thank you!


#4

I'm not sure I understand the answer here. After correcting this code it returns "16" but why not "Aaleah 16"? How is it distinguishing between name and age?


#5

What do you mean by "return"? There are no function calls in OP's code.


#6

Olá, também funciona assim:
var me = new Object();

me["name"] = "Edson";
me.age = 41;


#7

I just mean returns as the thing which appears as a result of the code.


#8

Well. There's no part of the code saying that something should be printed either. Something else is doing that!