I have the following code:
var nomePropriedade = "Propriedade1";
var meuObjeto = {
"nome" : "valor"
}
I would like the property name of meuObjeto
to receive the value of the nomePropriedade
variable.
Home
So when I try to access the properties of meuObjeto
I would have to do:
meuObjeto.Propriedade1
And the return would be: "valor"
. That is, it would be the same as:
var meuObjeto = {
Propriedade1 : "valor"
}
Is it possible to do this?